server { listen 80; server_name localhost; large_client_header_buffers 4 16k; client_max_body_size 300m; client_body_buffer_size 128k; proxy_connect_timeout 600; proxy_read_timeout 600; proxy_send_timeout 600; proxy_buffer_size 64k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; location / { root html; index index.html index.htm; } location /project { proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; if ($remote_addr ~ "192.168.9.138") { proxy_pass http://project1.server.com; break; } proxy_pass http://project2.server.com; } error_page 502 /502.html; location = /502.html { root html; } }
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/2337.html