Page 1 of 2

New Domains Redirecting

Posted: Thu Jan 04, 2018 9:27 pm
by jakestephens
Hi guys,

First off I have been using Vesta for over 18 months with no issues! However since the recent update I have been experiencing something strange on newly added domains/subdomains with no chances being made by myself.

If I add a domain/subdomain to a user with it adds without any errors but when browsing to that newly added site in any browsers and different devices it redirects to the root domain that Vesta was install on. I thought it was the user at first so created a new user added another site tested with another domain (different) it does the exact same thing.

I have tried running /usr/local/vesta/bin/v-rebuild-user [username] and /usr/local/vesta/bin/v-rebuild-web-domains [username] with no avail. There isn't anything I can see in any off the logs. One thing worth noting is the nginx.conf and snginx.conf are missing from the newly created user and the existing account in this location: /home/[username]/conf/web/.

I am running Centos 7, nginx + php-fpm with externally hosted DNS.

Any help would be greatly appreciated as it's been driving me nuts for the last few days!

Thanks in advance.

Re: New Domains Redirecting

Posted: Fri Jan 05, 2018 1:54 am
by mehargags
For that new user you created, can you post the nginx.conf and apache2.conf from his dir /home/user/web/

Re: New Domains Redirecting

Posted: Fri Jan 05, 2018 7:06 am
by jakestephens
mehargags wrote:For that new user you created, can you post the nginx.conf and apache2.conf from his dir /home/user/web/
The thing is even for a brand new user they don't get the nginx.conf & snginx.conf apart from the one specific for that domain. Have a look at these two screenshots.

https://ibb.co/dxbxjw
https://ibb.co/b05CHG

Re: New Domains Redirecting

Posted: Fri Jan 05, 2018 10:13 am
by mehargags
A fresh new user which doesn't have any domains created yet will not have any conf files in his .../conf/web directory. When you enable ssl, additional snginx/sapache2 conf files are made too.
But as in your second screenshot you do have nginx.conf file. Are you using Apache-less Nginx + PHP-FPM stack ?

Re: New Domains Redirecting

Posted: Fri Jan 05, 2018 10:35 am
by jakestephens
Yes that is correct I am running Nginx + PHP-FPM without Apache.

Re: New Domains Redirecting

Posted: Fri Jan 05, 2018 2:47 pm
by jakestephens
This is a copy of the test.jakestephens.co.uk.nginx.conf which redirects to the 'admin' URL that Vesta was used at the time of installing Vesta. This is a new test user and subdomain with an unmodified conf.

Code: Select all

server {
    listen      192.168.100.252:80 spdy;
    server_name test.jakestephens.co.uk ;
    root        /home/TestUsr/web/test.jakestephens.co.uk/public_html;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/test.jakestephens.co.uk.log combined;
    access_log  /var/log/nginx/domains/test.jakestephens.co.uk.bytes bytes;
    error_log   /var/log/nginx/domains/test.jakestephens.co.uk.error.log error;

    location / {

        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
            expires     max;
        }

        location ~ [^/]\.php(/|$) {
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;
            }

            fastcgi_pass    127.0.0.1:9003;
            fastcgi_index   index.php;
            include         /etc/nginx/fastcgi_params;
        }
    }

    error_page  403 /error/404.html;
    error_page  404 /error/404.html;
    error_page  500 502 503 504 /error/50x.html;

    location /error/ {
        alias   /home/TestUsr/web/test.jakestephens.co.uk/document_errors/;
    }

    location ~* "/\.(htaccess|htpasswd)$" {
        deny    all;
        return  404;
    }

    location /vstats/ {
        alias   /home/TestUsr/web/test.jakestephens.co.uk/stats/;
        include /home/TestUsr/conf/web/test.jakestephens.co.uk.auth*;
    }

    include     /etc/nginx/conf.d/phpmyadmin.inc*;
    include     /etc/nginx/conf.d/phppgadmin.inc*;
    include     /etc/nginx/conf.d/webmail.inc*;

    include     /home/TestUsr/conf/web/nginx.test.jakestephens.co.uk.conf*;
}
I have compared this config to a known working site which has been hosted on Vesta for over 18 months and it is pretty mich identical apart from the username. Some help unpicking this would be really appreciated as currently I can't add anymore sites due to them redirecting :(

Re: New Domains Redirecting

Posted: Fri Jan 05, 2018 3:28 pm
by mehargags
May be something to do with DNS ? But I checked it seems correct too... seriously no idea whats going on.. sorry for not being of much help

Re: New Domains Redirecting

Posted: Mon Apr 23, 2018 6:32 pm
by sirpros
I think this is the problem I have. Please have you been able to find a solution to this. Although its happening to just one of my domains at the moment. I really need help.

Re: New Domains Redirecting

Posted: Mon Apr 23, 2018 7:13 pm
by mehargags
Does it happen to SSL sites only or even the Non-SSL ones too ?

Re: New Domains Redirecting

Posted: Mon Apr 23, 2018 7:25 pm
by sirpros
This happened to just one of my domain on the server and even setting up ssl did not change it. It still happens.