initial commit

This commit is contained in:
straitz 2025-08-15 00:46:18 +09:00
commit c6961c03c3
33 changed files with 1782 additions and 0 deletions

45
nginx/nginx.conf Normal file
View file

@ -0,0 +1,45 @@
events {}
http {
upstream django {
server web:8000;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name localhost;
# Static files
location /static/ {
alias /app/static/;
expires 1y;
access_log off;
add_header Cache-Control "public";
gzip_static on;
}
# Media files
location /media/ {
alias /app/media/;
expires 7d;
access_log off;
add_header Cache-Control "public";
}
# Django app
location / {
proxy_pass http://django;
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_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
}