原文地址html
以下圖nginx
配置以下後端
#user nobody; worker_processes 8; worker_rlimit_nofile 65535; events { use epoll; worker_connections 8192; } #http核心 http { include mime.types; default_type application/octet-stream; client_max_body_size 10M; client_body_buffer_size 256k; #日誌格式 log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" ' '"$gzip_ratio" $request_time $bytes_sent $request_length'; access_log logs/access.log main; sendfile on; keepalive_timeout 65; upstream backend{ server 192.168.1.1 weight=1; server 192.168.1.1 weight=1; } #虛擬服務器 server { listen 80; server_name www.go008.com; location / { root html; index index.html index.htm; proxy_pass http://backend; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Cookie $http_cookie; chunked_transfer_encoding off; proxy_pass_header Set-Cookie; } #error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }