Skip to content

Commit

Permalink
fix(gateway): fix nginx conf support 4xx CORS;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Dec 31, 2021
1 parent 72a55e3 commit 421b854
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
31 changes: 16 additions & 15 deletions packages/gateway/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ server {
location / {

# Allow CORS
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Expose-Headers *;
add_header Access-Control-Max-Age 3600;
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS always;
add_header Access-Control-Allow-Headers * always;
add_header Access-Control-Expose-Headers * always;
add_header Access-Control-Max-Age 3600 always;

if ($request_method = 'OPTIONS') {
return 204;
Expand Down Expand Up @@ -44,11 +44,12 @@ server {

location /file {
# Allow CORS
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Expose-Headers *;
add_header Access-Control-Max-Age 3600;
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS always;
add_header Access-Control-Allow-Headers * always;
add_header Access-Control-Expose-Headers * always;
add_header Access-Control-Max-Age 3600 always;


if ($request_method = 'OPTIONS') {
return 204;
Expand Down Expand Up @@ -93,11 +94,11 @@ server {

location /deploy/incoming {
# Allow CORS
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Expose-Headers *;
add_header Access-Control-Max-Age 3600;
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS always;
add_header Access-Control-Allow-Headers * always;
add_header Access-Control-Expose-Headers * always;
add_header Access-Control-Max-Age 3600 always;

if ($request_method = 'OPTIONS') {
return 204;
Expand Down
10 changes: 5 additions & 5 deletions packages/gateway/fs-proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ server {

location / {
# Allow CORS
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Expose-Headers *;
add_header Access-Control-Max-Age 3600;
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS always;
add_header Access-Control-Allow-Headers * always;
add_header Access-Control-Expose-Headers * always;
add_header Access-Control-Max-Age 3600 always;

if ($request_method = 'OPTIONS') {
return 204;
Expand Down

0 comments on commit 421b854

Please sign in to comment.