1

Topic: Redirect loop after enabling HTTPS on fresh iRedMail install

Hi everyone, I’m new to iRedMail and just set up a fresh server. After enabling HTTPS, I’m getting a redirect loop when accessing both Roundcube and the admin panel.

Here’s the required info:

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====

iRedMail version: 1.7.1

Deployed with: Downloadable installer

Linux distribution: Ubuntu 22.04

Mail storage backend: MySQL

Web server: Nginx

Using iRedAdmin-Pro? No

Error message: Browser shows “ERR_TOO_MANY_REDIRECTS”. Nginx error log shows repeated:

rewrite or internal redirection cycle while processing "/"


Issue:
Everything works normally over HTTP. As soon as I enable SSL by adding my certs to the Nginx config, all web interfaces end up in a redirect loop.

Question:
Is there a standard change needed in the default Nginx config to safely enable HTTPS?
Or is there a specific block in the iRedMail-generated config that must remain untouched?

Any guidance would be greatly appreciated!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Redirect loop after enabling HTTPS on fresh iRedMail install

How did you "enable SSL"?

3

Re: Redirect loop after enabling HTTPS on fresh iRedMail install

The first thing I’d check is how HTTPS was enabled and whether the original iRedMail Nginx server blocks were modified. Since HTTP was working before, there may be a conflict between the SSL configuration and an existing rewrite or redirect rule.

Make sure the port 80 server block only redirects HTTP requests to HTTPS, while the port 443 block serves the application directly. Also check for any rewrite rules that send / back to itself, as the Nginx error about an internal redirection cycle suggests that could be happening.

It would help to compare the current Nginx configuration with the original iRedMail-generated files, particularly the Roundcube and iRedAdmin location blocks.

Could you share the Nginx server blocks you changed when enabling SSL? That would make it easier to identify the exact issue rather than changing the default configuration blindly.