1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/FastAPI_ynh.git synced 2024-09-03 18:36:00 +02:00

Update nginx.conf

This commit is contained in:
Éric Gaspar 2023-12-15 23:04:10 +01:00
parent 5235913731
commit d6156e0900

View file

@ -12,7 +12,7 @@ location __PATH__/ {
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
more_set_headers "Access-Control-Allow-Headers" 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
more_set_headers "Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range";
#
# Tell client that this pre-flight info is valid for 20 days
#
@ -21,7 +21,14 @@ location __PATH__/ {
more_set_headers "Content-Length: 0";
return 204;
}
if ($request_method = (POST|GET)$) {
if ($request_method = 'POST') {
more_set_headers "Access-Control-Allow-Origin: * always";
more_set_headers "Access-Control-Allow-Methods: GET, POST, OPTIONS always";
more_set_headers "Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range always";
more_set_headers "Access-Control-Expose-Headers: Content-Length,Content-Range always";
}
if ($request_method = 'GET') {
more_set_headers "Access-Control-Allow-Origin: * always";
more_set_headers "Access-Control-Allow-Methods: GET, POST, OPTIONS always";
more_set_headers "Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range always";