Question

How do i redirect from https to http with nginx?

Hi, I work with a couple of sites, the clients could ask or not for a SSL certificate, so: some sites have SSL certificate from Let’s Encrypt and other don’t have one.

I work with a LEMP stack for the wordpress sites, but I ran into a problem: when you try to access one of the sites with no SSL certificate it redirects them to another with a SSL certificate. I was wondering if it is posible to redirect all of the accesses from https:// to http:// in a site with no SSL certificate?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

The normal behavior is for the site to load via http:// and not https://

Can you check for any existing rules that are forcing the redirect? You can check the site’s vhost.

You can also check in the site’s database. For example in WordPress you define the home and siteurl.

Alex