Page 1 of 1

Allow Panel access only in one domain

Posted: Tue Jun 14, 2016 10:13 pm
by chiqui
Hi, Im trying to set up vesta to allow panel access only from only one domain, but Im note being able to do so. I've modified the nginx config file /usr/local/vesta/nginx/conf/nginx.conf to

Code: Select all

listen          mypaneldomain.com:8083;
# server_name     _;
server_name     mypaneldomain.com;
but I'm still able to access the login page from other domains... how can I achieve this? Thanks!

Re: Allow Panel access only in one domain

Posted: Wed Jun 15, 2016 8:29 am
by skurudo
Did you restart vesta-nginx service after changes?

Code: Select all

service vesta restart

Re: Allow Panel access only in one domain

Posted: Wed Jun 15, 2016 2:17 pm
by chiqui
Yes, already restarted the service but I can still access the panel from other domains. Any ideas? Thanks!

Re: Allow Panel access only in one domain

Posted: Tue Jun 21, 2016 8:36 am
by skurudo
Yep, I have some idea and tested this ;-)

Code: Select all

   server {
        listen          domain.ru:8083;
        server_name     domain.ru;
        root            /usr/local/vesta/web;
        charset         utf-8;
this code you already have in config, and something new for location /

before:

Code: Select all

   location / {
            expires max;
            index   index.php;
        }
now

Code: Select all

        
location / {
if ($host != $server_name) { rewrite ^ http://$host$request_uri? redirect; }
expires max;
index   index.php;
        }
You need add this string:
if ($host != $server_name) { rewrite ^ http://$host$request_uri? redirect; }

Re: Allow Panel access only in one domain

Posted: Sat Jan 07, 2017 1:37 pm
by Hund
Is it possible to access Roundcube and phpMyAdmin over only one domain? At this time I can reach the tools over every registred domain in Vesta. But I think it would be better to allow it only on a specific domain for security reasons.

Re: Allow Panel access only in one domain

Posted: Mon Jan 23, 2017 7:56 pm
by skurudo
Hund wrote:Is it possible to access Roundcube and phpMyAdmin over only one domain? At this time I can reach the tools over every registred domain in Vesta. But I think it would be better to allow it only on a specific domain for security reasons.
Manually - yes, possible.