Nginx - Password Protect an entire website but kee

2019-03-02 03:40发布

问题:

We're using Nginx on the server reserved for development (testing) and we want to prevent anyone outside the company from gaining access to the sites under development. However one of the sites uses online payment and for that a folder need to be accessible by anyone, used for the callback from the credit card company..

Is there any way we can protect an entire website but leave just one folder and all the files inside open ?

Regards,

Wael

回答1:

server {
        auth_basic "go away";
        location /a {
                auth_basic off;
        }
}