refactored nginx configs

- handle CORS within nginx
- remove allow-headers from CORS
- add custom dynamic error pages
- remove unused fastcgi
- removed OPTIONS backend
- remove previous custom errorDirective
- moved proxy directives to appropiate file
This commit is contained in:
Michael C
2022-01-06 18:42:48 -05:00
parent da03958e97
commit 164a9dab17
8 changed files with 59 additions and 69 deletions

10
nginx/cors.conf Normal file
View File

@@ -0,0 +1,10 @@
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE';
# cache CORS for 24 hours
add_header 'Access-Control-Max-Age' 86400;
# return empty response for preflight
add_header 'Content-Type' 'text/plain; charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}