new supervisor step2
This commit is contained in:
@ -1,33 +1,38 @@
|
||||
# HTTPS server
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name rogaining.sumasen.net;
|
||||
server_name rogaining.sumasen.net localhost;
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log debug;
|
||||
access_log /var/log/nginx/api_access.log;
|
||||
error_log /var/log/nginx/api_error.log debug;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization';
|
||||
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
# Django admin
|
||||
location ~ ^/(admin|api)/ {
|
||||
proxy_pass http://api:8100;
|
||||
proxy_http_version 1.1;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header X-CSRFToken $http_x_csrf_token;
|
||||
|
||||
# タイムアウト設定
|
||||
proxy_connect_timeout 300;
|
||||
proxy_send_timeout 300;
|
||||
proxy_read_timeout 300;
|
||||
send_timeout 300;
|
||||
}
|
||||
|
||||
# Supervisor webapp
|
||||
location /supervisor/ {
|
||||
alias /usr/share/nginx/html/supervisor/;
|
||||
try_files $uri $uri/ /supervisor/index.html;
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization';
|
||||
}
|
||||
|
||||
location /static/ {
|
||||
@ -36,6 +41,10 @@ server {
|
||||
add_header Cache-Control "public, no-transform";
|
||||
}
|
||||
|
||||
location = / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
}
|
||||
|
||||
error_page 404 /404.html;
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
Reference in New Issue
Block a user