Skip to content

Commit 2a18e07

Browse files
committed
add proxy_prefix to all 302 redirects to support heroku differing ports
1 parent 6fd0b62 commit 2a18e07

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nginx.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ http {
116116
return 404;
117117
}
118118
# if it exists, send appropriate redirection
119-
return 302 /main/$dest_referrerhost$request_uri;
119+
return 302 $proxy_prefix/main/$dest_referrerhost$request_uri;
120120
}
121121

122122

@@ -155,7 +155,7 @@ http {
155155
}
156156
# redirect any url with /main/google.com to /main/https://google.com
157157
location ~^/main(/[^/_]+_)?(?!(/[^/_]+_)?/(http|ws)s?://|//)/(?<rewrite_url_with_scheme>.*) {
158-
return 302 /main$1/$relativescheme://$rewrite_url_with_scheme;
158+
return 302 $proxy_prefix/main$1/$relativescheme://$rewrite_url_with_scheme;
159159
}
160160
# handle websocket connections
161161
location ~^/main/\d*ws_/(?<targeturl>.+){
@@ -182,7 +182,7 @@ http {
182182
}
183183
# redirect any url with /main/unsupportedmod_/blahblah to /main/blahblah
184184
location ~^/main/[^_/]+_/(?<redirecttargeturl>.+) {
185-
return 302 /main/$redirecttargeturl;
185+
return 302 $proxy_prefix/main/$redirecttargeturl;
186186
}
187187
location ~^/main/(?<targeturl>.*)$ {
188188
# blacklist urls

0 commit comments

Comments
 (0)