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:
parent
5235913731
commit
d6156e0900
1 changed files with 9 additions and 2 deletions
|
@ -12,7 +12,7 @@ location __PATH__/ {
|
||||||
#
|
#
|
||||||
# Custom headers and headers various browsers *should* be OK with but aren't
|
# 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
|
# Tell client that this pre-flight info is valid for 20 days
|
||||||
#
|
#
|
||||||
|
@ -21,7 +21,14 @@ location __PATH__/ {
|
||||||
more_set_headers "Content-Length: 0";
|
more_set_headers "Content-Length: 0";
|
||||||
return 204;
|
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-Origin: * always";
|
||||||
more_set_headers "Access-Control-Allow-Methods: GET, POST, OPTIONS 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-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range always";
|
||||||
|
|
Loading…
Add table
Reference in a new issue