From dc9a3520ba6c16cd636bede54b9897dcdbdd67fe Mon Sep 17 00:00:00 2001 From: Sanjay Kumar Srikakulam Date: Tue, 26 Mar 2024 10:10:33 +0000 Subject: [PATCH 1/2] Add upstream response headers that would otherwise be omitted to x_accel_redirect Refer: https://github.com/galaxyproject/galaxy/issues/17643 --- templates/nginx/galaxy-main.j2 | 4 ++++ templates/nginx/galaxy-test.j2 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/templates/nginx/galaxy-main.j2 b/templates/nginx/galaxy-main.j2 index 75c2fc016..8ebc41099 100644 --- a/templates/nginx/galaxy-main.j2 +++ b/templates/nginx/galaxy-main.j2 @@ -77,6 +77,10 @@ server { add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; + # Add upstream response headers that would otherwise be omitted + add_header Access-Control-Allow-Origin $upstream_http_access_control_allow_origin; + add_header Access-Control-Allow-Methods $upstream_http_access_control_allow_methods; + # CORS if ($http_origin ~ "^https?://(covid19map\.elixir-luxembourg\.org|avivator\.gehlenborglab\.org|www\.bx\.psu\.edu)$") { add_header Access-Control-Allow-Origin $http_origin; diff --git a/templates/nginx/galaxy-test.j2 b/templates/nginx/galaxy-test.j2 index 2db23ce61..4c97d10be 100644 --- a/templates/nginx/galaxy-test.j2 +++ b/templates/nginx/galaxy-test.j2 @@ -57,6 +57,10 @@ server { add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; + # Add upstream response headers that would otherwise be omitted + add_header Access-Control-Allow-Origin $upstream_http_access_control_allow_origin; + add_header Access-Control-Allow-Methods $upstream_http_access_control_allow_methods; + # CORS if ($http_origin ~ "^https?://(covid19map\.elixir-luxembourg\.org|www\.bx\.psu\.edu)$") { add_header Access-Control-Allow-Origin $http_origin; From 127699d5fd22150a64452346004b81c9e0118f01 Mon Sep 17 00:00:00 2001 From: Sanjay Kumar Srikakulam Date: Tue, 26 Mar 2024 10:12:44 +0000 Subject: [PATCH 2/2] lint --- templates/nginx/galaxy-main.j2 | 2 +- templates/nginx/galaxy-test.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/nginx/galaxy-main.j2 b/templates/nginx/galaxy-main.j2 index 8ebc41099..912a5c08a 100644 --- a/templates/nginx/galaxy-main.j2 +++ b/templates/nginx/galaxy-main.j2 @@ -79,7 +79,7 @@ server { # Add upstream response headers that would otherwise be omitted add_header Access-Control-Allow-Origin $upstream_http_access_control_allow_origin; - add_header Access-Control-Allow-Methods $upstream_http_access_control_allow_methods; + add_header Access-Control-Allow-Methods $upstream_http_access_control_allow_methods; # CORS if ($http_origin ~ "^https?://(covid19map\.elixir-luxembourg\.org|avivator\.gehlenborglab\.org|www\.bx\.psu\.edu)$") { diff --git a/templates/nginx/galaxy-test.j2 b/templates/nginx/galaxy-test.j2 index 4c97d10be..d184f1e80 100644 --- a/templates/nginx/galaxy-test.j2 +++ b/templates/nginx/galaxy-test.j2 @@ -59,7 +59,7 @@ server { # Add upstream response headers that would otherwise be omitted add_header Access-Control-Allow-Origin $upstream_http_access_control_allow_origin; - add_header Access-Control-Allow-Methods $upstream_http_access_control_allow_methods; + add_header Access-Control-Allow-Methods $upstream_http_access_control_allow_methods; # CORS if ($http_origin ~ "^https?://(covid19map\.elixir-luxembourg\.org|www\.bx\.psu\.edu)$") {