how to fix 502 bad gateway error in nginx

How To Fix “502 Bad Gateway” Error In Nginx

The 502 Bad Gateway error is an HTTP status code that means that one server received an invalid response from another server. In more technical words, A 502 Bad Gateway means that the proxy (gateway) server wasn’t able to get a valid or any response from the upstream server.

fixing 502 bad gateway error in nginx

If you are seeing a 502 bad gateway error on a website, it means that the origin server sent out an invalid response to another server that acted as a gateway or proxy. It can be a tricky investigation to locate what and where is the process which caused the issue. However, there are some general troubleshooting steps that you can follow to get it solved.

For example, if you use Nginx as the webserver and you encounter this issue, it could be that Nginx is unable to communicate with the upstream server, this upstream server could be PHP-FPM or other application that you want to access through Nginx, like Odoo, NodeJS, etc. (more…)

How To Create Temporary and Permanent Redirects with Nginx

How To Create Temporary and Permanent Redirects with Nginx

Today we will guide you through the process of creating temporary and permanent redirects with Nginx web server.

What is URL Redirect?

URL Redirect or also known as URL Forwarding, is a technique to redirect a domain name or an URL from a location to another. The common use for this redirection is when a page on your site has a good SEO ranking, and you need to change it for a specific reason. For example, you are switching from a CMS to another, this will make your URL structure changed. So, in order to keep your existing SEO rank of a page, you can redirect/forward the old URL to the new ones. (more…)

gzip compression in nginx

How to enable GZIP compression in Nginx

We’ll show you, How to enable GZIP compression in Nginx. Lately, it’s all about optimizing your website and making it as fast as possible. Especially since search engines like Google consider page load time as a ranking factor. And, of course, the load time is a huge factor in user experience.

Aside from using a fast, SSD-powered VPS, you can also do some other tweaks and settings to speed up your website, like enabling gzip compression in Nginx.

Here we’ll discuss one method that will increase the transfer speed by reducing the size of the files with compression. This method will also bring up the benefit of reducing the bandwidth that is used in this process and will make the hosting cheaper to the owner (ie, you can use a hosting plan with fewer resources. The best part about – it’s easy to do and it will only take you a few minutes.

In this article, we’ll share with you how to do the above with the Nginx gzip module. As it is stated this module will help you to compress your files with the gzip compression method. It is known that this method will reduce the size of the transmitted files by half or in some cases even more. (more…)