Nginx — static file serving confusion with root & alias

前端 未结 7 1100
[愿得一人]
[愿得一人] 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:28

    alias is used to replace the location part path (LPP) in the request path, while the root is used to be prepended to the request path.

    They are two ways to map the request path to the final file path.

    alias could only be used in location block, and it will override the outside root.

    alias and root cannot be used in location block together.

    0 讨论(0)
提交回复
热议问题