Nginx — static file serving confusion with root & alias

前端 未结 7 1255
[愿得一人]
[愿得一人] 2020-11-22 15:29

I need to serve my app through my app server at 8080, and my static files from a directory without touching the app server. The nginx config I have is something

7条回答
  •  没有蜡笔的小新
    2020-11-22 16:13

    In other words on keeping this brief: in case of root, location argument specified is part of filesystem's path and URI . On the other hand — for alias directive argument of location statement is part of URI only

    So, alias is a different name that maps certain URI to certain path in the filesystem, whereas root appends location argument to the root path given as argument to root directive.

提交回复
热议问题