nginx: auth_basic for everything except a specific location

后端 未结 4 1864
再見小時候
再見小時候 2021-02-05 04:03

How can I enable HTTP Basic Auth for everything except for a certain file?

Here is my current server block configuration for the location:

locat         


        
4条回答
  •  终归单人心
    2021-02-05 04:39

    Only auth_basic off didn't work for me If we have to skip auth for ALL uri's under our url

    location ^~ /some/location/to_skip/ {
      auth_basic off;
      try_files $uri $uri/ /index.html;
    }      
    

提交回复
热议问题