NGinx Best Practices httpdnginx What best practices do you use while using NGinx? Best Answer How to combine HTTP and HTTPS blocks. server { listen 80; listen 443 default ssl; # other directives } This was posted as an answer to a different question. See here. Related SolutionsNginx – How to see which flags Nginx was compiled with nginx -V will list all the configured modules. There is no explicit enable/load command. Nginx – Maintenance page on nginx, best practices I think the best practice would be returning a 500 status code. I think you mean 503 instead of 500. they use if to make the redirect and according to nginx documentation it isn't safe to use ifs. No. Only return is 100% safe inside if in location context. According to nginx documentation, you can specify an HTTP status code as the last argument to try_files. I've tried this but it didn't work. Related TopicNginx – need Nginx and something like GunicornNginx – How to Reload Nginx Config Without DowntimeNGINX Reverse Proxy – URL RewriteLinux – Difference in sites-available vs sites-enabled vs conf.d directories (Nginx)Nginx – How to Use Environment Variables in Nginx.conf
Best Answer
How to combine HTTP and HTTPS blocks.
This was posted as an answer to a different question. See here.