From ee03bf348c4915829dcec308a8cad61413b228dc Mon Sep 17 00:00:00 2001 From: Zhang Huangbin Date: Tue, 15 Mar 2016 21:27:10 +0800 Subject: [PATCH] SSync upgrade tutorial: [Nginx] Fixed: not explicitly define 'Content-Type: text/html' header for iRedAdmin. --- .../upgrade/0-upgrade.iredmail.0.9.4-0.9.5.md | 27 +++++++++++++++++++ html/upgrade.iredmail.0.9.4-0.9.5.html | 24 +++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/en_US/upgrade/0-upgrade.iredmail.0.9.4-0.9.5.md b/en_US/upgrade/0-upgrade.iredmail.0.9.4-0.9.5.md index 281335c9..c27677c8 100644 --- a/en_US/upgrade/0-upgrade.iredmail.0.9.4-0.9.5.md +++ b/en_US/upgrade/0-upgrade.iredmail.0.9.4-0.9.5.md @@ -6,6 +6,7 @@ > We offer remote upgrade service, check [the price](../support.html) and [contact us](../contact.html). +* 2016-03-15: [Nginx] Fixed: not explicitly define `Content-Type: text/html` header for iRedAdmin * 2016-03-08: [NEW] Supports Postfix `sender_dependent_relayhost_maps`. * 2016-02-25: * [RHEL/CentOS] Fixed: Not create required directory used to store PHP session files @@ -60,6 +61,32 @@ chmod 0773 /var/lib/php/session chmod o+t /var/lib/php/session ``` +### [Nginx] Fixed: not explicitly define `Content-Type: text/html` header for iRedAdmin + +We didn't add explicit `Content-Type` header for iRedAdmin pages, this will +cause error (web pages inaccessible) if you have setting +`add_header X-Content-Type-Options nosniff;` in Nginx. + +To prevent this issue, please add setting `add_header Content-Type 'text/html';` +in Nginx config file to explicitly define the content type, in +`location ~ ^/iredadmin(.*) {}` block: + +* On Linux/OpenBSD, it's `/etc/nginx/templates/iredadmin.tmpl` (iRedMail-0.9.3 + or newer releases) or `/etc/nginx/conf.d/default.conf`. +* On FreeBSD, it's `/usr/local/etc/nginx/templates/iredadmin.tmpl` + (iRedMail-0.9.3 or newer releases) or `/usr/local/etc/nginx/conf.d/default.conf`. + +``` +# Python scripts +location ~ ^/iredadmin(.*) { + add_header Content-Type 'text/html'; # <-- Add this line + + ... +} +``` + +Reloading or restarting Nginx service is required. + ### Fixed: not add alias for `virusalert` on non-Debian/Ubuntu OSes Note: this is __NOT__ applicable to Debian and Ubuntu. diff --git a/html/upgrade.iredmail.0.9.4-0.9.5.html b/html/upgrade.iredmail.0.9.4-0.9.5.html index 5e0a3fb3..dc9df51f 100644 --- a/html/upgrade.iredmail.0.9.4-0.9.5.html +++ b/html/upgrade.iredmail.0.9.4-0.9.5.html @@ -18,6 +18,7 @@
  • Upgrade iRedAPD (Postfix policy server) to the latest 1.9.0
  • [RHEL/CentOS] Fixed: Not enable cron job to update SpamAssassin rules
  • [RHEL/CentOS] Fixed: Not create required directory used to store PHP session files
  • +
  • [Nginx] Fixed: not explicitly define Content-Type: text/html header for iRedAdmin
  • Fixed: not add alias for virusalert on non-Debian/Ubuntu OSes
  • @@ -60,6 +61,7 @@

    We offer remote upgrade service, check the price and contact us.