mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-06-19 06:30:19 +08:00
fix: nginx default page hijacks port 80 in Docker image
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)
This commit is contained in:
@@ -2,19 +2,18 @@ server {
|
||||
listen 80;
|
||||
client_max_body_size 10G;
|
||||
|
||||
# gzip 压缩
|
||||
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;
|
||||
|
||||
# 所有非 /api 请求全部代理给 frontend 容器
|
||||
location / {
|
||||
proxy_pass http://frontend:80;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# 所有 /api 请求代理给 backend 容器
|
||||
location /api/ {
|
||||
proxy_pass http://backend:8483;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
Reference in New Issue
Block a user