forked from github/plane
53 lines
1.6 KiB
Nginx Configuration File
53 lines
1.6 KiB
Nginx Configuration File
upstream plane {
|
|
server localhost:80;
|
|
}
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
worker_processes 1;
|
|
|
|
|
|
error_log /var/log/nginx/error.log;
|
|
server_tokens off;
|
|
access_log /var/log/nginx/access.log;
|
|
|
|
http {
|
|
sendfile on;
|
|
upstream django {
|
|
server planebackend:8000;
|
|
}
|
|
upstream react {
|
|
server planefrontend:3000;
|
|
}
|
|
server {
|
|
listen 80;
|
|
root /www/data/;
|
|
access_log /var/log/nginx/access.log;
|
|
location / {
|
|
proxy_pass http://planefrontend:3000/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header Access-Control-Allow-Headers Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token;
|
|
proxy_set_header Access-Control-Allow-Methods OPTIONS,POST,GET,PUT;
|
|
proxy_set_header Access-Control-Allow-Credentials true;
|
|
add_header Access-Control-Allow-Origin *;
|
|
proxy_set_header X-Requested-With *;
|
|
}
|
|
location /api/ {
|
|
proxy_pass http://planebackend:8000/api/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Content-Type application/json;
|
|
proxy_set_header Access-Control-Allow-Headers Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token;
|
|
proxy_set_header Access-Control-Allow-Methods OPTIONS,POST,GET,PUT;
|
|
proxy_set_header Access-Control-Allow-Credentials true;
|
|
add_header Access-Control-Allow-Origin *;
|
|
proxy_set_header X-Requested-With *;
|
|
}
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|
|
} |