mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-16 09:35:10 +01:00
hm
This commit is contained in:
parent
a0fbbe11d3
commit
34c728b922
1 changed files with 7 additions and 14 deletions
|
|
@ -51,25 +51,18 @@ http {
|
||||||
server_name "api.cors-school.nilstrieb.dev";
|
server_name "api.cors-school.nilstrieb.dev";
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
|
|
||||||
|
add_header 'Access-Control-Allow-Origin' 'https://cors-school.nilstrieb.dev';
|
||||||
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
||||||
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, OPTIONS';
|
||||||
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,token,refresh-token,Authorization';
|
||||||
|
|
||||||
if ($request_method = 'OPTIONS') {
|
if ($request_method = 'OPTIONS') {
|
||||||
add_header 'Access-Control-Allow-Origin' 'https://cors-school.nilstrieb.dev';
|
|
||||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, OPTIONS';
|
|
||||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,token,refresh-token,Authorization';
|
|
||||||
add_header 'Content-Type' 'text/plain charset=UTF-8';
|
|
||||||
add_header 'Content-Length' 0;
|
|
||||||
return 204;
|
return 204;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request_method != 'OPTIONS') {
|
proxy_pass http://cors-school-backend:8080/;
|
||||||
add_header 'Access-Control-Allow-Origin' 'https://cors-school.nilstrieb.dev';
|
|
||||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, OPTIONS';
|
|
||||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,token,refresh-token,Authorization';
|
|
||||||
|
|
||||||
|
|
||||||
proxy_pass http://cors-school-backend:8080/;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue