- 菜品营养按食物成分表+烹饪方式校准(calibrate_nutrition 命令) - 后台接入 jazzmin 主题美化,移除 Google Fonts(模板覆盖) - 前端/后台静态资源指向 qnycdn 对象存储 CDN(vite base + DJANGO_STATIC_URL) - 菜单标题学校名称/周数可编辑,日期随周数计算 - admin 搜索支持拼音首字母/全拼(Dish.pinyin 索引,pypinyin) - Dockerfile 使用清华 pip 镜像源
56 lines
1.3 KiB
Nginx Configuration File
56 lines
1.3 KiB
Nginx Configuration File
upstream django_backend {
|
|
server backend:8000;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name xx.mymoyu.top qnycdn.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 /xx/web/ {
|
|
alias /usr/share/nginx/html/;
|
|
index index.html;
|
|
expires 7d;
|
|
}
|
|
|
|
location /xx/web/assets/ {
|
|
alias /usr/share/nginx/html/assets/;
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
expires 1y;
|
|
}
|
|
|
|
location /xx/admin/ {
|
|
alias /static/;
|
|
expires 7d;
|
|
}
|
|
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
try_files $uri /index.html;
|
|
}
|
|
}
|