Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When do I need to restart nginx

When do I need to restart nginx when using with django and uwsgi?
In case when templates are changed, static files are changed or any other reason?

like image 442
eugene Avatar asked Dec 02 '25 22:12

eugene


1 Answers

Probably only when you change its configuration, if you are referring to when your django code changes you have to restart the uwsgi server, usually "touch"ing the wsgi.py file is enough to instruct the uwsgi server.

Changes in static files don't require the uwsgi restart (because you usually serve them directly with nginx), and if you don't use cached template loaders, but only the default filesystem loader, you don't require the restart when changing a template either.

Note that the cached template loader is usually suggested in production.

like image 179
DRC Avatar answered Dec 05 '25 16:12

DRC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!