Change HTTPS to HTTP Nginx
What is Nginx?
Nginx (pronounced as “engine-x” is an open-source, high-performance web server created by Igor Sysoev. It is designed to be lightweight and fast, and to handle static content quickly and efficiently. Nginx is also used for proxying requests to other web services, such as PHP-based applications (like WordPress), and is commonly used in large-scale web applications, as well as for load-balancing.
Why Change From HTTPS to HTTP?
By default, Nginx is set up to run in a secure HTTPS mode – meaning that it serves websites using the encryption protocol known as SSL (Secure Socket Layer). This is great for any website that wants to securely transfer sensitive data, but for some sites, it can be an unnecessary security measure and a performance bottleneck.
For example, if a website is not dealing with sensitive information or has no need for encryption, then it may be beneficial to switch from HTTPS to HTTP. This can reduce the load on the server, as the encryption process is resource-intensive and can negatively impact performance. It can also reduce the page load time of the website, as browsers may need to make multiple SSL requests to render content.
Steps to Change HTTPS to HTTP with Nginx
If you’d like to switch from HTTPS to HTTP with Nginx, there are two steps you’ll need to take: remove the SSL certificate and reconfigure the server. Here are the basic steps you’ll need to follow in order to switch to HTTP:
- Remove the existing SSL certificate and disable the HTTPS configuration.
- Edit the existing Nginx configuration to enable HTTP and disable HTTPS.
- Reload the Nginx configuration and test the new HTTP configuration.
Before you attempt to switch from HTTPS to HTTP, be sure to back up your existing Nginx configuration in case something goes wrong. This will enable you to quickly restore the previous configuration if needed.
Removing the SSL Certificate
The first step is to remove the existing SSL certificate. You can do this by running the following command:
sudo rm -rf /etc/https-certificate
This command will remove the existing certificate, allowing you to configure the server for HTTP.
Reconfiguring Nginx for HTTP
Once the certificate has been removed, you’ll need to reconfigure the Nginx server to enable HTTP and disable HTTPS. To do this, open the server block configuration file (usually located at
/etc/nginx/sites-available/) and find the following lines:
listen 443 ssl;
Replace these lines with the following:
This will enable HTTP and disable the use of a SSL certificate. Next, save the changes and reload the Nginx configuration by running:
service nginx reload
Testing the New HTTP Configuration
Once the configuration has been reloaded, you can check that everything is working correctly by running the following command:
curl –I http://www.example.com
If the configuration is correct, you should see a ‘200 OK’ response. This will mean that the site is now running over HTTP.
1. How do I switch from HTTPS to HTTP?
In order to switch from HTTPS to HTTP with Nginx, you need to first remove the existing SSL certificate and then reconfigure the server to enable HTTP and disable HTTPS.
2. Is it safe to switch from HTTPS to HTTP?
If you are not dealing with sensitive data, or if your website does not need encryption, then it is safe to switch from HTTPS to HTTP. However, it is important to bear in mind that HTTP is not as secure as HTTPS, and so you should consider any potential security implications before making the switch.
3. Will switching from HTTPS to HTTP increase performance?
Yes, switching from HTTPS to HTTP can increase performance, as the encryption process can be resource-intensive and can negatively impact performance. Additionally, browsers may need to make multiple SSL requests in order to render content, which can increase page load times.
Switching from HTTPS to HTTP can be beneficial if a website does not need encryption, as it can reduce the load on the server and improve page load times. However, it is important to bear in mind that HTTP is not as secure as HTTPS, and so you should consider any potential security implications before making the switch.
Thank you for reading this article. If you found this article useful please read some of our other articles.