-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nginx-core): reorganize configuration files to fix many issues! (#81
- Loading branch information
Showing
13 changed files
with
33 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
nginx-core/etc/nginx/templates/location.d/31-allow-method.conf.template
This file was deleted.
Oops, something went wrong.
3 changes: 2 additions & 1 deletion
3
.../location.d/50-redirect-uri.conf.template → .../location.d/40-redirect-uri.conf.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
if ($redirect_uri) { | ||
return $NGINX_FORCE_REDIRECT_STATUS $redirect_uri; | ||
} | ||
break; | ||
} |
File renamed without changes.
18 changes: 0 additions & 18 deletions
18
nginx-core/etc/nginx/templates/location.d/70-cors.conf.template
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
nginx-core/etc/nginx/templates/location.d/90-root.conf.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
location / { | ||
include /etc/nginx/conf.d/location.d/root.d/*.conf; | ||
} |
17 changes: 17 additions & 0 deletions
17
nginx-core/etc/nginx/templates/location.d/root.d/10-cors.conf.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
add_header 'Access-Control-Allow-Origin' $NGINX_CORS_ORIGIN; | ||
add_header 'Access-Control-Allow-Methods' $NGINX_CORS_METHODS; | ||
add_header 'Access-Control-Allow-Headers' $NGINX_CORS_HEADERS; | ||
add_header 'Access-Control-Max-Age' $NGINX_CORS_MAXAGE; | ||
|
||
# Handle OPTIONS requests (preflight requests for complex requests) | ||
if ($request_method = 'OPTIONS') { | ||
add_header 'Access-Control-Allow-Origin' $NGINX_CORS_ORIGIN; | ||
add_header 'Access-Control-Allow-Methods' $NGINX_CORS_METHODS; | ||
add_header 'Access-Control-Allow-Headers' $NGINX_CORS_HEADERS; | ||
add_header 'Access-Control-Max-Age' $NGINX_CORS_MAXAGE; | ||
add_header 'Content-Type' 'text/plain charset=UTF-8'; | ||
add_header 'Content-Length' 0; | ||
|
||
return 204; | ||
break; | ||
} |
3 changes: 3 additions & 0 deletions
3
nginx-core/etc/nginx/templates/location.d/root.d/20-allow-method.conf.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
limit_except HEAD GET OPTIONS { | ||
deny all; | ||
} |
1 change: 1 addition & 0 deletions
1
.../location.d/40-force-domain.conf.template → ...on.d/root.d/30-force-domain.conf.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
if ($host != $NGINX_FORCE_DOMAIN) { | ||
return $NGINX_FORCE_DOMAIN_STATUS $scheme://$NGINX_FORCE_DOMAIN$request_uri; | ||
break; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters