{"id":15913,"date":"2019-11-24T05:50:40","date_gmt":"2019-11-24T05:50:40","guid":{"rendered":"https:\/\/blog.taragana.com\/?p=15913"},"modified":"2019-11-24T05:56:46","modified_gmt":"2019-11-24T05:56:46","slug":"production-how-to-check-and-fix-nginx-errors-before-deployment","status":"publish","type":"post","link":"https:\/\/blog.taragana.com\/production-how-to-check-and-fix-nginx-errors-before-deployment-15913","title":{"rendered":"Production: How to check and fix nginx errors before deployment"},"content":{"rendered":"\n

I will show a simple tip to test nginx configuration on live site ( production server ) before deployment.<\/p>\n\n\n\n

This is especially useful for server serving many different sites. A little mis-configuration, even a missed comma, can instantly bring down hundreds or even thousands of sites. So you should test it first:<\/p>\n\n\n\n

sudo service nginx configtest<\/code><\/pre>\n\n\n\n

If it fails then you can find the cause of failure at:<\/p>\n\n\n\n

tail \/var\/log\/nginx\/error.log<\/code><\/pre>\n\n\n\n

Fix it (verify using configtest<\/code> as above and then run as usual:<\/p>\n\n\n\n

sudo service nginx reload<\/code><\/pre>\n\n\n\n

nginx, currently at 33% market share, is a very popular web server.<\/p>\n","protected":false},"excerpt":{"rendered":"

I will show a simple tip to test nginx configuration on live site ( production server ) before deployment. This is especially useful for server serving many different sites. A little mis-configuration, even a missed comma, can instantly bring down hundreds or even thousands of sites. So you should test it first: If it fails […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[132],"_links":{"self":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts\/15913"}],"collection":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/comments?post=15913"}],"version-history":[{"count":2,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts\/15913\/revisions"}],"predecessor-version":[{"id":15915,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts\/15913\/revisions\/15915"}],"wp:attachment":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/media?parent=15913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/categories?post=15913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/tags?post=15913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}