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
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.