[GH-ISSUE #1296] Webmail contents not showing when using NGINX as Reverse Proxy #1047

Closed
opened 2026-02-27 11:14:56 +03:00 by kerem · 3 comments
Owner

Originally created by @jasonaleski on GitHub (Nov 13, 2017).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1296

This really isn't an issue (anymore), but thought I'd share a solution to a problem I have been having. Modoboa was installed with the installer, but NGINX was reconfigured to be used as a Reverse Proxy; mainly for SSL offloading. I've had this issue with prior version of Modoboa installer, but never took the time to truly troubleshoot it...until now. For the most part, Modoboa back-end would work, except when displaying email content. It would display the headers, but not the actual content. The fix, at least for me, is below.

Impacted versions

  • Modoboa: 1.9.1
  • installer used: Yes/No ?
  • Webserver: Nginx

Steps to reproduce/Current Problem

Webmail content unable to display while running behind Nginx (acting as a Reverse Proxy).

Expected behavior

Show email contents via webmail.

Proposed solutions that did not work:

In the /srv/modoboa/instance/instance/settings.py, the following X_FRAME_OPTIONS did NOT work (different instances of the configuration):

X_FRAME_OPTIONS = "SAMEORIGIN"
X_FRAME_OPTIONS = "DENY"

Solution that worked

In the /srv/modoboa/instance/instance/settings.py, set the following:
X_FRAME_OPTIONS = "ALLOW-FROM https://mailserver.yourdomain.com"

I originally thought the configuration error was in Nginx, but then realized that the UWSGI server was confused due to the nature of the Reverse Proxy request.

Hopefully this will help someone in the future.

Originally created by @jasonaleski on GitHub (Nov 13, 2017). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1296 This really isn't an issue (anymore), but thought I'd share a solution to a problem I have been having. Modoboa was installed with the installer, but NGINX was reconfigured to be used as a Reverse Proxy; mainly for SSL offloading. I've had this issue with prior version of Modoboa installer, but never took the time to truly troubleshoot it...until now. For the most part, Modoboa back-end would work, except when displaying email content. It would display the headers, but not the actual content. The fix, at least for me, is below. # Impacted versions * Modoboa: 1.9.1 * installer used: Yes/No ? * Webserver: Nginx # Steps to reproduce/Current Problem Webmail content unable to display while running behind Nginx (acting as a Reverse Proxy). # Expected behavior Show email contents via webmail. # Proposed solutions that did not work: In the /srv/modoboa/instance/instance/settings.py, the following X_FRAME_OPTIONS did NOT work (different instances of the configuration): ``` X_FRAME_OPTIONS = "SAMEORIGIN" X_FRAME_OPTIONS = "DENY" ``` # Solution that worked In the /srv/modoboa/instance/instance/settings.py, set the following: `X_FRAME_OPTIONS = "ALLOW-FROM https://mailserver.yourdomain.com"` I originally thought the configuration error was in Nginx, but then realized that the UWSGI server was confused due to the nature of the Reverse Proxy request. Hopefully this will help someone in the future.
kerem closed this issue 2026-02-27 11:14:56 +03:00
Author
Owner

@jasonaleski commented on GitHub (Nov 13, 2017):

Just passing information to be documented.

<!-- gh-comment-id:344087467 --> @jasonaleski commented on GitHub (Nov 13, 2017): Just passing information to be documented.
Author
Owner

@guillim commented on GitHub (Nov 29, 2017):

Had the same issue. your trick solved it. tks

<!-- gh-comment-id:347766226 --> @guillim commented on GitHub (Nov 29, 2017): Had the same issue. your trick solved it. tks
Author
Owner

@ntninja commented on GitHub (May 9, 2019):

Thank you, this helped me figure out why viewing messages did not work on my instance.

<!-- gh-comment-id:491039187 --> @ntninja commented on GitHub (May 9, 2019): Thank you, this helped me figure out why viewing messages did not work on my instance.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1047
No description provided.