1.nginx.conf 详细配置说明:
#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for $request_length $request_time $upstream_addr $server_name'; sendfile on; keepalive_timeout 65; gzip on; gzip_http_version 1.1; gzip_types application/json text/javascript text/plain application/x-javascript text/css application/xml; gzip_comp_level 5; proxy_intercept_errors on; client_max_body_size 100M; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffers 4 32k; proxy_buffer_size 8k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; upstream cn.tvpad.com { server 127.0.0.1:8080; } upstream en.tvpad.com { server 127.0.0.1:8080; } upstream www.tvpad.com { server 127.0.0.1:8080; } include vhosts/*.conf; # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #}}
2. 详细配置说明:
server { listen 80; charset utf-8; server_name www.tvpad.com; access_log logs/www_access_log main; error_log logs/www_error.log error; location ~*/manager { proxy_pass http://www.tvpad.com; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location ~* ^.+\.(html|css|jpg|gif|png|js|jpeg)$ { root G:\\workspace\\lshop_new\\WebRoot; index index.html; } location / { proxy_pass http://www.tvpad.com; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }}