From ad998656e2bde373619c5cd4ec0578034d8548ba Mon Sep 17 00:00:00 2001 From: ftimme Date: Tue, 27 Sep 2011 10:59:19 +0000 Subject: [PATCH] - Changed FastCGI buffers for ISPConfig nginx vhost because otherwise you get "upstream sent too big header while reading response header from upstream" on OpenSUSE. - Added 502 error page ("Bad Gateway"). - Added "fastcgi_intercept_errors on;" to nginx vhost template so that ISPConfig's error pages are displayed instead of the default nginx ones. --- install/tpl/nginx_apps.vhost.master | 7 ++- install/tpl/nginx_ispconfig.vhost.master | 10 ++-- server/conf/error/br/502.html | 61 ++++++++++++++++++++++++ server/conf/error/cz/502.html | 61 ++++++++++++++++++++++++ server/conf/error/de/502.html | 61 ++++++++++++++++++++++++ server/conf/error/en/502.html | 61 ++++++++++++++++++++++++ server/conf/error/es/502.html | 61 ++++++++++++++++++++++++ server/conf/error/fi/502.html | 61 ++++++++++++++++++++++++ server/conf/error/fr/502.html | 61 ++++++++++++++++++++++++ server/conf/error/gr/502.html | 61 ++++++++++++++++++++++++ server/conf/error/hu/502.html | 61 ++++++++++++++++++++++++ server/conf/error/it/502.html | 61 ++++++++++++++++++++++++ server/conf/error/nl/502.html | 61 ++++++++++++++++++++++++ server/conf/error/pl/502.html | 61 ++++++++++++++++++++++++ server/conf/error/se/502.html | 61 ++++++++++++++++++++++++ server/conf/error/si/502.html | 61 ++++++++++++++++++++++++ server/conf/error/sr/502.html | 61 ++++++++++++++++++++++++ server/conf/nginx_apps.vhost.master | 7 ++- server/conf/nginx_vhost.conf.master | 7 ++- server/conf/vhost.conf.master | 1 + 20 files changed, 940 insertions(+), 7 deletions(-) create mode 100644 server/conf/error/br/502.html create mode 100644 server/conf/error/cz/502.html create mode 100644 server/conf/error/de/502.html create mode 100644 server/conf/error/en/502.html create mode 100644 server/conf/error/es/502.html create mode 100644 server/conf/error/fi/502.html create mode 100644 server/conf/error/fr/502.html create mode 100644 server/conf/error/gr/502.html create mode 100644 server/conf/error/hu/502.html create mode 100644 server/conf/error/it/502.html create mode 100644 server/conf/error/nl/502.html create mode 100644 server/conf/error/pl/502.html create mode 100644 server/conf/error/se/502.html create mode 100644 server/conf/error/si/502.html create mode 100644 server/conf/error/sr/502.html diff --git a/install/tpl/nginx_apps.vhost.master b/install/tpl/nginx_apps.vhost.master index 30416e3e3a..b0bd3a3e21 100644 --- a/install/tpl/nginx_apps.vhost.master +++ b/install/tpl/nginx_apps.vhost.master @@ -15,11 +15,16 @@ server { } location ~ \.php$ { + try_files $uri =404; + include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:{fpm_port}; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; - include /etc/nginx/fastcgi_params; + fastcgi_buffer_size 128k; + fastcgi_buffers 256 4k; + fastcgi_busy_buffers_size 256k; + fastcgi_temp_file_write_size 256k; } location ~ /\. { diff --git a/install/tpl/nginx_ispconfig.vhost.master b/install/tpl/nginx_ispconfig.vhost.master index 2c9173b151..ffaf7607f5 100644 --- a/install/tpl/nginx_ispconfig.vhost.master +++ b/install/tpl/nginx_ispconfig.vhost.master @@ -18,11 +18,15 @@ server { location ~ \.php$ { try_files $uri =404; + include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:{fpm_port}; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; - include /etc/nginx/fastcgi_params; + fastcgi_buffer_size 128k; + fastcgi_buffers 256 4k; + fastcgi_busy_buffers_size 256k; + fastcgi_temp_file_write_size 256k; } location ~ /\. { @@ -35,11 +39,11 @@ server { location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; + include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:{fpm_port}; {ssl_comment}fastcgi_param HTTPS {fastcgi_ssl}; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; - include /etc/nginx/fastcgi_params; } location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; @@ -55,11 +59,11 @@ server { location ~ ^/squirrelmail/(.+\.php)$ { try_files $uri =404; root /usr/share/; + include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:{fpm_port}; {ssl_comment}fastcgi_param HTTPS {fastcgi_ssl}; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; - include /etc/nginx/fastcgi_params; } location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; diff --git a/server/conf/error/br/502.html b/server/conf/error/br/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/br/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/cz/502.html b/server/conf/error/cz/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/cz/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/de/502.html b/server/conf/error/de/502.html new file mode 100644 index 0000000000..1d7afb3043 --- /dev/null +++ b/server/conf/error/de/502.html @@ -0,0 +1,61 @@ + + + + FEHLER 502 - Fehlerhaftes Gateway! + + + + + +
+ +
+

Folgender Fehler ist aufgetreten:

+

Dieser Server hat eine ungültige Antwort von einem Upstream-Server erhalten, auf den zugegriffen wurde, um die Anforderung zu erfüllen.

+

Sollten Sie diese Fehlermeldung öfter erhalten, wenden Sie sich bitte an den Webmaster.

+
+ +
+ + diff --git a/server/conf/error/en/502.html b/server/conf/error/en/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/en/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/es/502.html b/server/conf/error/es/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/es/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/fi/502.html b/server/conf/error/fi/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/fi/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/fr/502.html b/server/conf/error/fr/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/fr/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/gr/502.html b/server/conf/error/gr/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/gr/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/hu/502.html b/server/conf/error/hu/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/hu/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/it/502.html b/server/conf/error/it/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/it/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/nl/502.html b/server/conf/error/nl/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/nl/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/pl/502.html b/server/conf/error/pl/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/pl/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/se/502.html b/server/conf/error/se/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/se/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/si/502.html b/server/conf/error/si/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/si/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/error/sr/502.html b/server/conf/error/sr/502.html new file mode 100644 index 0000000000..62a1b02469 --- /dev/null +++ b/server/conf/error/sr/502.html @@ -0,0 +1,61 @@ + + + + ERROR 502 - Bad Gateway! + + + + + +
+ +
+

The following error occurred:

+

This server received an invalid response from an upstream server it accessed to fulfill the request.

+

If you get this message repeatedly please contact the webmaster.

+
+ +
+ + diff --git a/server/conf/nginx_apps.vhost.master b/server/conf/nginx_apps.vhost.master index 30416e3e3a..b0bd3a3e21 100644 --- a/server/conf/nginx_apps.vhost.master +++ b/server/conf/nginx_apps.vhost.master @@ -15,11 +15,16 @@ server { } location ~ \.php$ { + try_files $uri =404; + include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:{fpm_port}; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; - include /etc/nginx/fastcgi_params; + fastcgi_buffer_size 128k; + fastcgi_buffers 256 4k; + fastcgi_busy_buffers_size 256k; + fastcgi_temp_file_write_size 256k; } location ~ /\. { diff --git a/server/conf/nginx_vhost.conf.master b/server/conf/nginx_vhost.conf.master index 53fefbb202..fd057311b0 100644 --- a/server/conf/nginx_vhost.conf.master +++ b/server/conf/nginx_vhost.conf.master @@ -44,6 +44,7 @@ server { error_page 404 /error/404.html; error_page 405 /error/405.html; error_page 500 /error/500.html; + error_page 502 /error/502.html; error_page 503 /error/503.html; @@ -77,6 +78,7 @@ server { location ~ \.php$ { try_files $uri =404; + include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:; @@ -86,7 +88,7 @@ server { fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; - include /etc/nginx/fastcgi_params; + fastcgi_intercept_errors on; } location ~ \.php$ { @@ -97,12 +99,13 @@ server { location /cgi-bin/ { try_files $uri =404; + include /etc/nginx/fastcgi_params; root ; gzip off; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_index index.cgi; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include /etc/nginx/fastcgi_params; + fastcgi_intercept_errors on; } diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master index 5d589236d0..8ea14b7f12 100644 --- a/server/conf/vhost.conf.master +++ b/server/conf/vhost.conf.master @@ -33,6 +33,7 @@ ErrorDocument 404 /error/404.html ErrorDocument 405 /error/405.html ErrorDocument 500 /error/500.html + ErrorDocument 502 /error/502.html ErrorDocument 503 /error/503.html -- GitLab