Only troubles lately with 16.04 on Linode

Ok everyone … I am in weird situation here.

I installed EE on ubuntu 16.04 LTS / Linode and I have had nothing but issues. I would like to hear if anyone had the same experience, because I am thinking of killing these servers :

  1. Admin tools don’t install …
  2. EE doesn’t install correctly sometimes, other times it does.
  3. Nginx is redirecting to default site in some situations …
    For example : at my house, everything works. At my work, NGINX redirects to the default site (which is empty). On some computers it works only with firefox, on others it doesn’t. At my work it doesn’t work with chrome, but at my house it does. etc.etc.etc.etc.etc.

It’s just a silly, stupid and ridiculous situation … Anyone had the same experience ?

Not at all. Easyengine works perfect on Ubuntu16.04. I think you have to understand NGINX behaviout concerning “default server” - thats all IMHO

Ingobaab : thanks for implying that I don’t understand what I am doing - without even knowing that I’ve setup NGINX servers without EE and did that succesfully …

So FYI: ive setup nginx without the help of EE before and never had an issue …

Lex, I am also in the middle of setting up WP using EE on Ubuntu 16.04 LTS in Linode.

Well, may I ask you when did you change/update the nameservers (in Linode DNS manager)? If its only a few minutes back, its completely normal to experience this, since it takes time for the DNS propagation depending on the TTL values you had previously set.

Do this to confirm: nslookup yoursitename.com

If this returns the correct IP address of your linode, then it should be working fine by this time in all (most) browsers and devices across all networks, I believe. But if it returns the previous linode’s or registrar’s IP address, then you need to wait till the propagation is complete.

For me, the above command shows the updated IP in my mac terminal but in my linode’s terminal, it shows the old one… So i am waiting…

Lex: I did’nt want to offend you - sorry, you got me wrong!

You can always check what’s going on with http or https with:

curl -k https://localhost -H 'Host: www.domain.com -I

-k does not verify your certificate
-I shows header

If your nginx has not setup for answering to “www.domain.de” it will deliver the default.

Kind Regards, -Ingo

Hi eetry,

Yes, it’s been a while since I entered the DNS info. about a week … The problems have been coming up the last few days, without me even touching the config. And again, I’ve only had this on linode for some reason … So propagation isn’t the issue (unfortunately ! ) …

I’ve actually removed the linodes now and am considering going back to a different provider … I just got so fed up with these bugs …

Lex

If its been one week, then its has nothing to do with DNS propagation. Did you check the www and non-www versions of your website across different devices? Is it one version or the other thats causing this issue?

Checked everything …

Works from home, doesn’t work from the office with the same setup. Works from office through VPN, but it has nothing to do with IP’s … works from specific computer on FF, but not from my laptop with FF … does not work on my laptop with chrome, but DOES work with my laptop and chrome from home … etc etc.

I think it’s a user agent code that is constantly being identified differently, but also that doesn’t make sense …

Honestly … I don’t care anymore … I’ve deleted the linodes and am going on a break from this anyway …

Ok … so I couldn’t help myself and rebuild the linodes and yes …looked at the problem again …

It turns out that NGINX is resolving to the wrong server block (namely the default block) even if the domain that is entered is correct. The strange thing is that it resolves to the wrong server block from only my office … when try it from my house, it does it correctly.

Now, I can solve this by forcing NGINX with default server, but that can’t be the right thing to do … why is NGINX not resolving to the server block corresponding to the domain name that is entered in the browser ? And why is it doing it wrong only from my office location, and not from the house ? That’s really strange… Any ideas ?

Did you try Flushing the dns cache of the device in which you experience this?

Yes … have done browser cache clearning, DNSflush and even tried it through googles DNS servers in order to rule out my ISP’s DNS …

The problem persists and seems to be NGINX related. It’s a mystery to me why NGINX catches the default site from this location, while when browsing from other locations, it catches the correct site …

And now I have nearly solved it … however I don’t understand what it means :

When I installed the WP site with the EE command, it left the default in /etc/nginx/sites-enabled. This should not be a problem since NGINX should catch my domainname.com and then serve the correct site … This was not always happening, and it was not happening in a strange fashion …

After looking at /etc/nginx/sites-enabled/default, I commented out the following :

Default server configuration

server { listen 80 default_server; listen [::]:80 default_server; <---------------------IF I COMMENT THIS OUT, THEN IT WORKS !!!

    # SSL configuration
    #

Is this NORMAL behavior for NGINX ? I don’t know … anyone have any comments on this ?

For anybody having this issue … the solutions is here : http://serverfault.com/questions/800683/nginx-serves-wrong-site-inconsistently-deepening-on-browsing-location

1 Like

Lex, I read your post and the reply. Thank you very much for taking the time to write down your solution.

I agree with the IPv6 thing. It’s better to disable the IPv6 in the server block. But I have done it system-wide by editing the /etc/gai.conf and uncomment the following line to set precedence to IPv4:

precedence ::ffff:0:0/96 100

I did so because my ‘sudo apt-get update’ used to get stuck at some point since it tries with IPv6. When the precedence is set to IPv4, its smooth. I guess you experienced something similar, though it was in the server block.

Regarding the ‘default’ file in the /etc/nginx/sites-enabled/ directory, after hosting multiple wordpress or non wordpress sites, the usual thing is to get rid of it. I have my ‘default’ file removed. So i didn’t get a chance to experience that situation of IPv6 taking precedence and loading the ‘default’ page.

After 2 days of hair-pulling, you learned something useful… so did I…

eetry,

Thanks … I hope that it’s useful for others …

It turns out that the reason why it worked at home and not at work is because I believe that ISP that I use at work must be converting IPv4 to IPv6 by defeault … there can’t be another reason … the result would then be that because the domain name is not listening for IPv6, BUT the default site IS, it would revert back to the default config.

On the other hand, at home, I probably my ISP is probably more ‘conservative’… (or I have an old router or so) … Sooooooooo … that’s it :))

I have had the exept same problem. I also fixed it by removing the default in enabled sites