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

前端 未结 3 955
情话喂你
情话喂你 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:29

    location = /aliasname/ { 
      alias /path/to/alias/
    }
    

    Trailing slash will be a problem if it is not present in URI. See https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms#matching-location-blocks

提交回复
热议问题