Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
gesis.mybinder.org build redirect: allow all origins if request as no…
Browse files Browse the repository at this point in the history
… origin, otherwise allow only value of request origin (jupyterhub/mybinder.org-deploy#1344)
  • Loading branch information
bitnik committed Feb 20, 2020
1 parent b7017d7 commit dcc7960
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion load_balancer/sites-available/gesis_mybinder
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
map $http_origin $allowed_origin {
default $http_origin;
"" "*";
}

# HTTP server to redirect gesis.mybinder.org 80 traffic to SSL/HTTPS
server {
listen 80;
Expand Down Expand Up @@ -42,7 +47,7 @@ server {
limit_except GET {
deny all;
}
add_header Access-Control-Allow-Origin $http_origin;
add_header Access-Control-Allow-Origin $allowed_origin;
add_header Vary Origin;
add_header "Access-Control-Allow-Credentials" "true";
add_header 'Access-Control-Allow-Headers' 'cache-control';
Expand Down

0 comments on commit dcc7960

Please sign in to comment.