File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 69
69
}
70
70
71
71
proxy_read_timeout 5s ;
72
- # proxy_intercept_errors on;
72
+ proxy_intercept_errors on ;
73
73
#proxy_next_upstream_tries 1;
74
74
75
75
server {
78
78
error_log /tmp/nginx-test-upstrand-error.log info;
79
79
access_log /tmp/nginx-test-upstrand-access.log fmt;
80
80
81
- error_page 503 =200 /error;
81
+ error_page 503 =200 /Internal/ error;
82
82
83
83
dynamic_upstrand $dus1 $arg_a us2;
84
84
@@ -120,9 +120,6 @@ http {
120
120
location /echo/dus1 {
121
121
echo $dus1 ;
122
122
}
123
- location /error {
124
- echo "Caught by error_page" ;
125
- }
126
123
127
124
location /zus1 {
128
125
# test with either
@@ -135,6 +132,10 @@ http {
135
132
proxy_pass http://$upstrand_us1 ;
136
133
}
137
134
135
+ location /Internal/error {
136
+ internal ;
137
+ echo "Caught by error_page" ;
138
+ }
138
139
location /Internal/failover {
139
140
internal ;
140
141
echo_status 503;
@@ -195,7 +196,7 @@ http {
195
196
196
197
location / {
197
198
add_header Upstrand-Server 8060 ;
198
- add_header X-Accel-Redirect /error;
199
+ add_header X-Accel-Redirect /Internal/ error;
199
200
echo "In 8060" ;
200
201
}
201
202
}
Original file line number Diff line number Diff line change @@ -101,12 +101,12 @@ __DATA__
101
101
102
102
location / {
103
103
add_header Upstrand-Server 8060 ;
104
- add_header X -Accel-Redirect / error;
104
+ add_header X -Accel-Redirect / Internal / error;
105
105
echo " In 8060" ;
106
106
}
107
107
}
108
108
-- - config
109
- error_page 503 = 200 / error;
109
+ error_page 503 = 200 / Internal / error;
110
110
111
111
dynamic_upstrand $ dus1 $ arg_a us2;
112
112
@@ -150,9 +150,6 @@ __DATA__
150
150
location / echo/ dus1 {
151
151
echo $ dus1 ;
152
152
}
153
- location / error {
154
- echo " Caught by error_page" ;
155
- }
156
153
157
154
location / zus1 {
158
155
gzip on;
@@ -161,6 +158,10 @@ __DATA__
161
158
proxy_pass http: // $ upstrand_us1 ;
162
159
}
163
160
161
+ location / Internal/ error {
162
+ internal;
163
+ echo " Caught by error_page" ;
164
+ }
164
165
location / Internal/ failover {
165
166
internal;
166
167
echo_status 503 ;
You can’t perform that action at this time.
0 commit comments