mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-06-18 22:20:22 +08:00
Two issues in Dockerfile.complete caused the nginx welcome page to appear instead of the BiliNote UI: 1. /etc/nginx/sites-enabled/default had `listen 80 default_server` which took priority over the custom config in conf.d/ 2. The nginx config proxied / to frontend:80, but the Dockerfile sed replaced it with 127.0.0.1:8080 where no service was running. The frontend is built as static files in /usr/share/nginx/html/. Fix: - Remove /etc/nginx/sites-enabled/default in Dockerfile - Change location / to serve static files directly instead of proxying - Remove the frontend proxy sed (no longer needed)
31 lines
738 B
Plaintext
31 lines
738 B
Plaintext
server {
|
|
listen 80;
|
|
client_max_body_size 10G;
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_proxied any;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
|
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location /api/ {
|
|
proxy_pass http://backend:8483;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
location /static/ {
|
|
proxy_pass http://backend:8483/static/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
expires 7d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
}
|