htaccess protect Vesta
htaccess protect Vesta
Please how can protect Vesta with htaccess.
I want protect vesta with htaccess Authentication.
I want protect vesta with htaccess Authentication.
Re: htaccess protect Vesta
Nope, Vesta use nginx and nginx not support htaccess.
If you want add access from IP you can try this code in /usr/local/vesta/nginx/conf/nginx.conf
If you wih add additional authorization, you can do it with nginx - http://nginx.org/en/docs/http/ngx_http_ ... odule.html
Example (not tested):
Create a .htpasswd file under your website directory being served by nginx. The following command would create the file and also add the user and an encrypted password to it.
The tool will prompt you for a password.
The structure of the htpasswd file would be like this:
Then add the two lines into the following path:
/usr/local/vesta/nginx/conf/nginx.conf
and restart Vesta services
If you want add access from IP you can try this code in /usr/local/vesta/nginx/conf/nginx.conf
Code: Select all
location / {
allow 192.168.1.100;
deny all;
expires max;
index index.php;
}
Example (not tested):
Create a .htpasswd file under your website directory being served by nginx. The following command would create the file and also add the user and an encrypted password to it.
Code: Select all
sudo htpasswd -c /etc/nginx/.htpasswd exampleuser
Code: Select all
New password:
Re-type new password:
Adding password for user exampleuser
Code: Select all
login:password
/usr/local/vesta/nginx/conf/nginx.conf
Code: Select all
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
expires max;
index index.php;
}
Code: Select all
service vesta restart