forked from github/plane
Update nginx.conf
This commit is contained in:
parent
1e5f45eafb
commit
1310611df5
@ -26,21 +26,29 @@ server {
|
|||||||
root /www/data/;
|
root /www/data/;
|
||||||
access_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
location / {
|
location / {
|
||||||
|
|
||||||
proxy_pass http://planefrontend:3000/;
|
proxy_pass http://planefrontend:3000/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
# Simple requests
|
||||||
|
if ($request_method ~* "(GET|POST)") {
|
||||||
|
add_header "Access-Control-Allow-Origin" *;
|
||||||
|
}
|
||||||
|
# Preflighted requests
|
||||||
|
if ($request_method = OPTIONS ) {
|
||||||
|
add_header "Access-Control-Allow-Origin" *;
|
||||||
|
add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD, PUT";
|
||||||
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,Authorization, Origin, X-Requested-With, Accept,If-Modified-Since,Cache-Control,Content-Type';
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT';
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT';
|
||||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
||||||
}
|
}
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://planebackend:8000/api/;
|
proxy_pass http://planebackend:8000/api/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Content-Type application/json;
|
proxy_set_header Content-Type application/json;
|
||||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT';
|
|
||||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
||||||
}
|
}
|
||||||
error_page 500 502 503 504 /50x.html;
|
error_page 500 502 503 504 /50x.html;
|
||||||
location = /50x.html {
|
location = /50x.html {
|
||||||
|
Loading…
Reference in New Issue
Block a user