This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
load_balancer/sites-available Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ server {
31
31
32
32
location / {
33
33
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301
34
- limit_except GET {
34
+ limit_except GET OPTIONS {
35
35
deny all;
36
36
}
37
37
# https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
@@ -40,11 +40,13 @@ server {
40
40
add_header 'Cache-Control' 'no-cache';
41
41
# https://serverfault.com/questions/426673/nginx-redirect-subdomain-to-sub-directory
42
42
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#taxing-rewrites
43
- return 301 https://notebooks.gesis.org/binder$request_uri;
43
+ return 308 https://notebooks.gesis.org/binder$request_uri;
44
44
}
45
45
46
46
location /build/ {
47
- limit_except GET {
47
+ # add OPTIONS for Preflighted requests: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
48
+ # adding OPTIONS is just to be safe, I am not sure if this is preflighted
49
+ limit_except GET OPTIONS {
48
50
deny all;
49
51
}
50
52
add_header Access-Control-Allow-Origin $allowed_origin;
@@ -53,7 +55,7 @@ server {
53
55
add_header 'Access-Control-Allow-Headers' 'cache-control';
54
56
add_header 'Content-Type' 'text/event-stream';
55
57
add_header 'Cache-Control' 'no-cache';
56
- return 301 https://notebooks.gesis.org/binder$request_uri;
58
+ # use Permanent Redirect (308) instead of 301, mybinder.org redirects with 307
59
+ return 308 https://notebooks.gesis.org/binder$request_uri;
57
60
}
58
61
}
59
-
You can’t perform that action at this time.
0 commit comments