Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

htaccess protect Vesta

General questions about VestaCP
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
petr.dudi
Posts: 6
Joined: Sat Aug 13, 2016 9:18 am

htaccess protect Vesta
  • Quote

Post by petr.dudi » Sun Aug 14, 2016 7:22 pm

Please how can protect Vesta with htaccess.

I want protect vesta with htaccess Authentication.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: htaccess protect Vesta
  • Quote

Post by skurudo » Mon Aug 15, 2016 7:20 am

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

Code: Select all

location / {
allow 192.168.1.100;
deny all;
expires max;
index index.php;
}
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.

Code: Select all

  sudo htpasswd -c /etc/nginx/.htpasswd exampleuser
The tool will prompt you for a password.

Code: Select all

New password:
Re-type new password:
Adding password for user exampleuser
The structure of the htpasswd file would be like this:

Code: Select all

login:password
Then add the two lines into the following path:
/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;
}
and restart Vesta services

Code: Select all

service vesta restart
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password