39 lines
934 B
Nginx Configuration File
39 lines
934 B
Nginx Configuration File
upstream django_backend {
|
|
server backend:8000;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name xx.mymoyu.top _;
|
|
|
|
client_max_body_size 20m;
|
|
gzip on;
|
|
gzip_types text/plain text/css application/javascript application/json;
|
|
|
|
location /api/ {
|
|
proxy_pass http://django_backend;
|
|
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;
|
|
}
|
|
|
|
location /admin/ {
|
|
proxy_pass http://django_backend;
|
|
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 /static/;
|
|
expires 7d;
|
|
}
|
|
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
try_files $uri /index.html;
|
|
}
|
|
}
|