Welcome! Log In Create A New Profile

Advanced

reloading nginx with tons of virtual hosts

Posted by ahrboktrexon 
reloading nginx with tons of virtual hosts
October 09, 2017 03:36AM
Hi guys,
I'm having some strange behaviour with nginx. I've a website which provides services across multiple third level domains (something like sitea.example.com, siteb.example.com and so on)

The file with server aliases is created dynamically and nginx reloaded with a cron job.

I noticed that a simple "reload" is not enough to tell to nginx to reload (and eventually create) the file with new aliases.

I use a simple "include" in the server section, that points to the file with aliases.

Any ideas/suggestion?

Thank you
Re: reloading nginx with tons of virtual hosts
October 30, 2017 11:23PM
This is somewhat common, it's not every time a systemctl reload nginx can do the trick, but you'll need to do a full restart (systemctl restart nginx) especially if you are using ssl
Re: reloading nginx with tons of virtual hosts
October 31, 2017 01:24AM
Hi JoakimR,
I solved the problem replacing the entry in crontab.
The command "service nginx reload" executed as root by crond caused the problem, instead, service nginx reload executed as root from terminal worked flawlessly.

So I replaced "service nginx reload" with "/etc/init.d/nginx reload" in crond and everything worked perfectly.

Thank you for your help.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 133
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready