diff --git a/app/front/nginx.conf b/app/front/nginx.conf index 0ee161a..e69de29 100644 --- a/app/front/nginx.conf +++ b/app/front/nginx.conf @@ -1,31 +0,0 @@ -events { - worker_connections 1024; -} - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - # 配置前端路由,支持SPA(单页应用) - server { - listen 80; - server_name localhost; - - root /usr/share/nginx/html; - index index.html; - - # 处理静态文件 - location / { - try_files $uri $uri/ /index.html; - } - - # 代理API请求到后端 - location /api/ { - proxy_pass http://backend:5000/; - 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; - } - } -} \ No newline at end of file diff --git a/app/docker-compose.yml b/docker-compose.yml similarity index 100% rename from app/docker-compose.yml rename to docker-compose.yml diff --git a/front/nginx.conf b/front/nginx.conf new file mode 100644 index 0000000..0ee161a --- /dev/null +++ b/front/nginx.conf @@ -0,0 +1,31 @@ +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + # 配置前端路由,支持SPA(单页应用) + server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + # 处理静态文件 + location / { + try_files $uri $uri/ /index.html; + } + + # 代理API请求到后端 + location /api/ { + proxy_pass http://backend:5000/; + 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; + } + } +} \ No newline at end of file