问题
Am implementing basic authentication on my Ubuntu server. I want to except url and all it follows. example, the url i want to except is sample.com/sample/ and all of it follows like sample.com/sample/1, sample.com/sample/2, sample.com/sample/samdsFFGRwd12, sample.com/sample/FHFEdsa1g65
How to make this possible?
回答1:
To exclude URL from the basic authentication of nginx, need to add in your nginx conf something like:
location /sample/ {
auth_basic off;
}
来源:https://stackoverflow.com/questions/38431499/nginx-basic-authentication-on-all-pages-except-a-specific-url-and-its-follow