- docker-compose.yml: 替换 NestJS 后端为 Java (Spring Boot) + MySQL 8.0 - 前端端口 3000:80,后端端口 8080:8080,MySQL 端口 3306:3306 - nginx.conf: proxy_pass 改为 http://backend:8080(Java 内部端口) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
439 B
Nginx Configuration File
22 lines
439 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Vue Router history 模式支持
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# 反向代理后端 API
|
|
location /api/ {
|
|
proxy_pass http://backend:8080;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
location /uploads/ {
|
|
proxy_pass http://backend:8080;
|
|
}
|
|
}
|