Răsfoiți Sursa

Remove global headers from nginx.conf

Fixes issue #383.
Kristan Kenney 6 ani în urmă
părinte
comite
533425e34c
2 a modificat fișierele cu 8 adăugiri și 3 ștergeri
  1. 0 2
      install/deb/nginx/nginx.conf
  2. 8 1
      install/upgrade/1.00.0-190621.sh

+ 0 - 2
install/deb/nginx/nginx.conf

@@ -116,8 +116,6 @@ http {
     ssl_stapling_verify on;
     ssl_stapling_verify on;
     resolver 1.0.0.1 1.1.1.1 valid=300s ipv6=off;
     resolver 1.0.0.1 1.1.1.1 valid=300s ipv6=off;
     resolver_timeout    5s;
     resolver_timeout    5s;
-    add_header          X-Frame-Options SAMEORIGIN;
-    add_header          X-Content-Type-Options nosniff;
 
 
     # Error pages
     # Error pages
     error_page 403 /error/404.html;
     error_page 403 /error/404.html;

+ 8 - 1
install/upgrade/1.00.0-190621.sh

@@ -23,4 +23,11 @@ if [ "$version" != "1.00.0-190618" ] && [ "$version" != "0.10.0" ] then
     source $HESTIA/install/upgrade/1.00.0-190618.sh
     source $HESTIA/install/upgrade/1.00.0-190618.sh
 fi
 fi
 
 
-# Place additional commands below.
+# Place additional commands below.
+
+# Remove global options from nginx.conf to prevent conflicts with other web packages
+if [ -e /etc/nginx/nginx.conf ]; then
+    echo "(*) Updating NGINX global configuration..."
+    sed -i 's/add_header          X-Frame-Options SAMEORIGIN;/d' /etc/nginx/nginx.conf
+    sed -i 's/add_header          X-Content-Type-Options nosniff;/d' /etc/nginx/nginx.conf
+fi