Redirection error on the 2nd website configured in Nginx Virtual Blocks after adding ssl certifcate from Lets Encrypt using cerbot



  1. Added VirtualBlock A to Nginx on Ubuntu.Site A works fine.
  2. Used certbot to add an ssl certificate from Lets Encrypt. Site A Works fine.
  3. Added Virutalock B to Nginx. Site B Works fine.
  4. Used certbot to add an ssl certificate from Lets Encrypt. Site B stops working with error as below.

“The page isn’t redirecting properly”

any help would be greatly appreciated.

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.

Hi @harishkgarg,

This might not be related to your Nginx configuration but rather to your website one.

This error usually pops up when you accidentally have a series of rewrite directives that cause an infinite redirect loop, or if your PHP code is sending bad HTTP redirects that are causing an infinite loop.

You can debug the issue by doing the following in your browser:

  • Open a new tab.
  • Open your Developer Tools (in chrome, Ctrl+Shift+I) and switch to the “Network” tab.
  • Click “Preserve log” so that your request history is not lost on each redirect.
  • Load the URL that is redirecting infinitely in your browser.
  • Look at the requests being made in the “Network” tab to identify what URLs nginx or PHP is sending back to the browser as redirects. By seeing the actual URLs your browser is trying to visit, you can usually identify the logic error that is causing the infinite loop.

If you remove the block for Site B for 443/SSL, I’ll be sure the website will start working properly again.

Please try something of the above and let me know how it goes.

Regards, KDSys