Skip to content

Commit 8b83537

Browse files
authored
remove: redundant fastcgi intercept error directives from site config stubs (#39)
The `fastcgi_intercept_errors` and `error_page` directives that were added in #26 are redundant in the site configs, they are not used by nginx. It is only the main `valet.conf` that nginx uses these directives from, all others are ignored in sites configs. Also the `proxy_intercept_errors` directive is not needed either since the `fastcgi_intercept_errors` directive will also do the same job for proxied sites. * Removed `proxy_intercept_errors on;` and `fastcgi_intercept_errors on;` directives from all proxy and fastcgi locations in the nginx stubs: `proxy.valet.conf`, `secure.proxy.valet.conf`, `secure.valet.conf`, and `unsecure.valet.conf`. * Deleted the custom error page configuration for HTTP 500, 502, 503, and 504 errors, including the internal `/500.html` location and references to `VALET_ERROR_TEMPLATE_PATH`, from all affected configuration stubs.
2 parents bf606d5 + eadbb40 commit 8b83537

4 files changed

Lines changed: 0 additions & 63 deletions

File tree

cli/stubs/proxy.valet.conf

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ server {
3838
proxy_redirect off;
3939
proxy_buffering off;
4040

41-
proxy_intercept_errors on;
42-
fastcgi_intercept_errors on;
43-
4441
# Prevent being cached...
4542
# Code from https://ubiq.co/tech-blog/disable-nginx-cache/
4643

@@ -59,14 +56,6 @@ server {
5956
location ~ /\.ht {
6057
deny all;
6158
}
62-
63-
# Internal server error page. Mainly for PHP errors.
64-
error_page 500 502 503 504 /500.html;
65-
66-
location = /500.html {
67-
internal;
68-
root "VALET_ERROR_TEMPLATE_PATH";
69-
}
7059
}
7160

7261
server {
@@ -95,20 +84,9 @@ server {
9584
proxy_set_header X-Real-IP $remote_addr;
9685
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
9786
proxy_set_header X-Forwarded-Proto $scheme;
98-
99-
proxy_intercept_errors on;
100-
fastcgi_intercept_errors on;
10187
}
10288

10389
location ~ /\.ht {
10490
deny all;
10591
}
106-
107-
# Internal server error page. Mainly for PHP errors.
108-
error_page 500 502 503 504 /500.html;
109-
110-
location = /500.html {
111-
internal;
112-
root "VALET_ERROR_TEMPLATE_PATH";
113-
}
11492
}

cli/stubs/secure.proxy.valet.conf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ server {
4848
proxy_redirect off;
4949
proxy_buffering off;
5050

51-
proxy_intercept_errors on;
52-
fastcgi_intercept_errors on;
53-
5451
# Prevent being cached...
5552
# Code from https://ubiq.co/tech-blog/disable-nginx-cache/
5653

@@ -69,12 +66,4 @@ server {
6966
location ~ /\.ht {
7067
deny all;
7168
}
72-
73-
# Internal server error page. Mainly for PHP errors.
74-
error_page 500 502 503 504 /500.html;
75-
76-
location = /500.html {
77-
internal;
78-
root "VALET_ERROR_TEMPLATE_PATH";
79-
}
8069
}

cli/stubs/secure.valet.conf

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,11 @@ server {
5656
fastcgi_param SCRIPT_FILENAME "VALET_SERVER_PATH";
5757
fastcgi_param HOME 'HOME_PATH';
5858
fastcgi_param PATH_INFO $fastcgi_path_info;
59-
60-
fastcgi_intercept_errors on;
6159
}
6260

6361
location ~ /\.ht {
6462
deny all;
6563
}
66-
67-
# Internal server error page. Mainly for PHP errors.
68-
error_page 500 502 503 504 /500.html;
69-
70-
location = /500.html {
71-
internal;
72-
root "VALET_ERROR_TEMPLATE_PATH";
73-
}
7464
}
7565

7666
server {
@@ -109,19 +99,9 @@ server {
10999
fastcgi_param SCRIPT_FILENAME "VALET_SERVER_PATH";
110100
fastcgi_param HOME 'HOME_PATH';
111101
fastcgi_param PATH_INFO $fastcgi_path_info;
112-
113-
fastcgi_intercept_errors on;
114102
}
115103

116104
location ~ /\.ht {
117105
deny all;
118106
}
119-
120-
# Internal server error page. Mainly for PHP errors.
121-
error_page 500 502 503 504 /500.html;
122-
123-
location = /500.html {
124-
internal;
125-
root "VALET_ERROR_TEMPLATE_PATH";
126-
}
127107
}

cli/stubs/unsecure.valet.conf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,9 @@ server {
4646
fastcgi_param SCRIPT_FILENAME "VALET_SERVER_PATH";
4747
fastcgi_param HOME 'HOME_PATH';
4848
fastcgi_param PATH_INFO $fastcgi_path_info;
49-
50-
fastcgi_intercept_errors on;
5149
}
5250

5351
location ~ /\.ht {
5452
deny all;
5553
}
56-
57-
# Internal server error page. Mainly for PHP errors.
58-
error_page 500 502 503 504 /500.html;
59-
60-
location = /500.html {
61-
internal;
62-
root "VALET_ERROR_TEMPLATE_PATH";
63-
}
6454
}

0 commit comments

Comments
 (0)