Learn about Centmin Mod LEMP Stack today
Register Now

Nginx 2 Websites under same VPS (2nd website redirects to 1st one)

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Stephen3000, May 3, 2019.

  1. Stephen3000

    Stephen3000 New Member

    May 3, 2019
    Local Time:
    8:40 PM
    Later Edit:

    Found the problem.

    Remember earlier when you asked me if I had something in my /etc/hosts file? Well, I checked my actual local PC like a noob, instead of looking into the server /etc/hosts file too.

    Well after I've read just now a guide about this on the digitalocean forums, I finally opened the actual /etc/hosts file of my SERVER (instead of my PC) and Immediately seen the problem.

    I had my server hostname added in there, but there was an error in the address for example instead of: main.hostname.com it was: main. hostname.com (basically a space after the first dot).

    So, of course, I removed the empty space, saved the hosts file and restarted nginx, and yeah it's curling fine now. Even from putty.

    Can't believe I wasted my time and yours for such a simple idiotic mistake...

    So I gotta apologize for my noobines :) and wish you a great week.
    Last edited: May 7, 2019
    • Informative Informative x 1