Nginx doesn't allow a global location directive
-
14-10-2022 - |
Question
I want to configure a location directive that is inherited by all server blocks.
In Apache, if I use the Alias directive outside the Virtualhost block, it applies to all virtualhosts, each host can access the location provided.
In Nginx, when I put the location directive outside a server block, it says "location directive is not allowed here".
Is there a better solution than re-defining the location in each server block?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow