I am using Nginx 1.8.0 on Ubuntu 12.04 with multiples domains, right now all my websites are online and working but I would like to change the port and others things in the conf of each domain (inside /etc/nginx/sites-available/domane).
The strange thing is : If i stop nginx : the wesbites are offline, which is normal. If i have a syntax error in some conf file : nginx warn me and wont restart, which is normal too.
But every changes i make doesnt seem to apply, like I can change the listen port to 1234 (or whatever), reload/restart nginx, the website still online. I can remove the domain in sites-enabled, reload/restart nginx, the website still online.
I use nginx for more than 5 years and its the first time I see that. Is there any cache or something new in the nginx configuration that i could have missed ?
2 Answers
I know I am late to the party, but for those who find this through google: Try launching the url from a different browser ;)
Explanation: If you set a bogus redirect rule in a config with a permanent switch, most browsers will remember this rule and cache it. For example chrome caches it in some internal file that can not be cleared by removing cookies and site data - you have to actually clear full browser history and all browsing data for the last x hours.
You can check your configuration with
sudo nginx -t -c /etc/nginx/nginx.confUsually that file includes
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;And /etc/nginx/sites-enabled/* are symlinks to /etc/nginx/sites-available/*, so edit the actual files, and check the config before reloading.