初始化项目文件
This commit is contained in:
86
build_file/dev/default.conf
Normal file
86
build_file/dev/default.conf
Normal file
@ -0,0 +1,86 @@
|
||||
upstream api_iris {
|
||||
server api_iris:8080;
|
||||
}
|
||||
upstream api_django {
|
||||
server api_django:8000;
|
||||
}
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
proxy_read_timeout 600;
|
||||
client_max_body_size 9000m;
|
||||
autoindex on;
|
||||
autoindex_exact_size off;
|
||||
set_real_ip_from 192.168.0.0/16;
|
||||
real_ip_header proxy_protocol;
|
||||
autoindex_localtime on;
|
||||
charset utf-8;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://api_iris/api/;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
location /api_django/ {
|
||||
proxy_pass http://api_django/api/;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
location /admin/ {
|
||||
proxy_pass http://api_iris/admin/;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
location /static/ {
|
||||
alias /data/static/;
|
||||
}
|
||||
location /upload/ {
|
||||
internal;
|
||||
alias /data/upload/;
|
||||
sendfile on;
|
||||
charset utf-8;
|
||||
}
|
||||
location /upload-note/ {
|
||||
internal;
|
||||
alias /data/upload-note/;
|
||||
sendfile on;
|
||||
charset utf-8;
|
||||
}
|
||||
location /upload-video/ {
|
||||
internal;
|
||||
alias /data/upload-video/;
|
||||
sendfile on;
|
||||
add_header Cache-Control no-cache;
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
||||
types {
|
||||
application/vnd.apple.mpegurl m3u8;
|
||||
video/mp2t ts;
|
||||
}
|
||||
charset utf-8;
|
||||
}
|
||||
|
||||
location ^~/ws {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-NginX-Proxy true;
|
||||
proxy_pass http://api_iris/ws;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
autoindex on;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user