Skip to content

Commit 51c42c4

Browse files
committed
stylistic improvements in nginx configurations
1 parent 8e58f7f commit 51c42c4

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

nginx.conf

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ http {
6969
}
7070

7171
proxy_read_timeout 5s;
72-
#proxy_intercept_errors on;
72+
proxy_intercept_errors on;
7373
#proxy_next_upstream_tries 1;
7474

7575
server {
@@ -78,7 +78,7 @@ http {
7878
error_log /tmp/nginx-test-upstrand-error.log info;
7979
access_log /tmp/nginx-test-upstrand-access.log fmt;
8080

81-
error_page 503 =200 /error;
81+
error_page 503 =200 /Internal/error;
8282

8383
dynamic_upstrand $dus1 $arg_a us2;
8484

@@ -120,9 +120,6 @@ http {
120120
location /echo/dus1 {
121121
echo $dus1;
122122
}
123-
location /error {
124-
echo "Caught by error_page";
125-
}
126123

127124
location /zus1 {
128125
# test with either
@@ -135,6 +132,10 @@ http {
135132
proxy_pass http://$upstrand_us1;
136133
}
137134

135+
location /Internal/error {
136+
internal;
137+
echo "Caught by error_page";
138+
}
138139
location /Internal/failover {
139140
internal;
140141
echo_status 503;
@@ -195,7 +196,7 @@ http {
195196

196197
location / {
197198
add_header Upstrand-Server 8060;
198-
add_header X-Accel-Redirect /error;
199+
add_header X-Accel-Redirect /Internal/error;
199200
echo "In 8060";
200201
}
201202
}

test/t/basic.t

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ __DATA__
101101

102102
location / {
103103
add_header Upstrand-Server 8060;
104-
add_header X-Accel-Redirect /error;
104+
add_header X-Accel-Redirect /Internal/error;
105105
echo "In 8060";
106106
}
107107
}
108108
--- config
109-
error_page 503 =200 /error;
109+
error_page 503 =200 /Internal/error;
110110

111111
dynamic_upstrand $dus1 $arg_a us2;
112112

@@ -150,9 +150,6 @@ __DATA__
150150
location /echo/dus1 {
151151
echo $dus1;
152152
}
153-
location /error {
154-
echo "Caught by error_page";
155-
}
156153

157154
location /zus1 {
158155
gzip on;
@@ -161,6 +158,10 @@ __DATA__
161158
proxy_pass http://$upstrand_us1;
162159
}
163160

161+
location /Internal/error {
162+
internal;
163+
echo "Caught by error_page";
164+
}
164165
location /Internal/failover {
165166
internal;
166167
echo_status 503;

0 commit comments

Comments
 (0)