demo-int-table/nginx/nginx.conf

73 lines
1.9 KiB
Nginx Configuration File

user root;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream django {
server back:8000;
keepalive 16;
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://front:4173;
proxy_set_header Host $host:$server_port;
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 /api/ {
proxy_pass http://back:8000/api/;
client_max_body_size 64M;
}
location /files/ {
proxy_pass http://back:8000/files/;
client_max_body_size 64M;
}
location /back/files/ {
proxy_pass http://back:8000/files/;
client_max_body_size 64M;
}
location /admin/ {
proxy_pass http://back:8000/admin/;
client_max_body_size 64M;
}
location /static/admin/ {
proxy_pass http://back:8000/static/admin/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}