How to make nginx to stop processing other rules and serve a specific location?

前端 未结 3 984
情话喂你
情话喂你 2021-01-01 15:45

I have this config that works as expected in an empty server { } definition

location ^~ /foo/ {
    al         


        
3条回答
  •  攒了一身酷
    2021-01-01 16:16

    Location blocks in Nginx are exclusive. If you use location ^~ then other rules probably expiry headers for static objects will not apply unless you copy those rules as nested under the same location block.

    If you could share your full config then I can make it work for you. Most likely you need to use nested location blocks.

提交回复
热议问题