# nginx.conf user root; # 定义 Nginx 进程的运行用户 worker_processes 1; # 设置 Nginx 进程数 events { worker_connections 1024; # 每个 worker 进程最大连接数 } http { include mime.types; default_type application/octet-stream; server { listen 8008; server_name localhost; location / { root /usr/share/nginx/html; try_files $uri $uri/ /index.html; } location /api/ { rewrite ^/api/(.*)$ /$1 break; proxy_pass http://localhost:8009; 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 /tele-images/ { proxy_pass http://localhost:8009; proxy_set_header Host $host; } } }