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 ?

You can check your configuration with

sudo nginx -t -c /etc/nginx/nginx.conf

Usually 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.

  • Already did, i have no error at all and the change doesnt apply, that is my problem. – Tahola Jul 15 '15 at 17:56
  • The only 2 things that i can think of, is starting nginx directly and make sure you are using the correct config file with sudo nginx -c /etc/nginx/nginx.conf, and test the website with curl to see if there's any proxy cache. – bistoco Jul 15 '15 at 18:12

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.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.