events { worker_connections 1024; } http{ include /etc/nginx/mime.types; #文件扩展名与文件类型映射表,否则前端不加载css default_type application/octet-stream; #默认文件类型 proxy_buffer_size 128k; proxy_buffers 32 128k; proxy_busy_buffers_size 128k; proxy_connect_timeout 300s; proxy_send_timeout 300s; proxy_read_timeout 300s; server { listen 5100; root /app; # 工作目录是/app 这里跟Dockerfile里相同 underscores_in_headers on; add_header X-Frame-Options "SAMEORIGIN"; try_files $uri $uri/ /index.html; location ^~ /front/ { proxy_pass http://172.16.200.18:8081/; proxy_connect_timeout 2s; proxy_read_timeout 600s; proxy_send_timeout 600s; client_max_body_size 1000m; } } }