0 votes
32 views
by Rookie

Hi,

I want to password protect an entire staging site, so httpauth -wp-admin=on isn't enough. Based on a few answers on similar topics, my understanding is that in order to achieve that, I will have to edit the nginx config files under /etc/nginx/common

If I do so, though, wouldn't my changes get lost after a Webinoly update? At least that's what the warnings on those files suggest.

So, I was wondering if there is a better way to do it. I tried creating a custom-nginx.conf file on the root on my site and added the following rule:

location = / {
        include common/acl.conf;
}

It will password protect the Homepage, but not the internal pages. If i remove = and keep only location /, nginx -t throws an error saying that location / is a duplicate.

If I do location ~ / It will password protect everything, but after signing in, only the home page works. The rest of the pages will throw a server error.

Thanks in advance for any suggestions

George

1 Answer

0 votes
by Expert
selected by
 
Best answer

Just put the "include acl" line in /etc/nginx/sites-available/domain.com, in the server block and before the first include in that block, in this case you don't need the location directive, then restart the Nginx service.

And as I mentioned several times before here, this feature will be included in the next major release (v1.9.0).

by Rookie
Thank you for the instant response.

I think that I tried that too on my first efforts but it didn't work at first. I must have missed something (maybe it was the order, because I think that I put it right before the last one).

I followed your suggestion now and it worked perfectly.

Thanks again for the great product and support!
Welcome to the Community site for Webinoly.

If you have a question about Webinoly, please ask in English or Spanish.

To report a bug, please ask a question here with the bug tag.

News: Now you can use any external SMTP service in your server. All the server outgoing emails from any of your websites will be sent through this service.

Donations

Webinoly Support Paypal Donations Webinoly Support Bitcoin Donations

Your regular donations is what keep this project moving forward. If you like Webinoly, buy me a coffee or a beer to show support.

Affiliate Links

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...