server { listen [::]:80; server_name localhost; #access_log /var/log/nginx/host.access.log main; ## 默认路径 location / { alias /mnt/workspace/demo; index index.html; client_max_body_size 1000m; } ## 指定前缀的访问路径 location /demo { alias /mnt/workspace/demo; index index.html; client_max_body_size 1000m; } ## 请求接口 location ^~ /demo-api/ { rewrite ^/demo-api/(.*) /$1 break; proxy_pass http://jin-ma-tower:9001; client_max_body_size 1000m; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forward-For $remote_addr; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } ##文件上传 location /upload { alias /mnt/upload; autoindex on; } }