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 2048; multi_accept on; } 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"'; access_log logs/access.log main; sendfile on; tcp_nopush on; keepalive_timeout 20s; server_names_hash_bucket_size 64; gzip on; #on or off gzip_min_length 1k; #min compress file length gzip_buffers 4 16k; gzip_http_version 1.1; #compress protocol version gzip_comp_level 2; #compress level gzip_types text/plain application/x-javascript text/css application/xml; #default text/html gzip_vary on; #upstream 192.168.1.105 { # server 192.168.1.105:8090 max_fails=2 fail_timeout=60s weight=2; # server 192.168.1.105:8080 max_fails=2 fail_timeout=60s weight=1; #} server { listen 80; server_name hotelping.cn www.hotelping.cn localhost m.hotelping.cn www.pogoy.cn pogoy.cn www.knowledgesocial.com.cn knowledgesocial.com.cn www.nowledgedata.com.cn nowledgedata.com.cn; charset UTF-8; access_log logs/host.access.log main; include proxy.conf; location / { if ( $host ~ "(.*)nowledgedata.com.cn" ) { rewrite ^(.*)$ /home/$1 last; } if ( $host ~ "(.*)pogoy.cn" ) { rewrite ^(.*)$ /pogoy/$1 last; } if ( $host ~ "(.*)knowledgesocial.com.cn" ) { rewrite ^(.*)$ /sgtz/$1 last; } index index.jsp index.html; proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Via "nginx"; } location /home { index index.html index.htm; proxy_pass http://127.0.0.1:8090; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Via "nginx"; } location ~ /pogoy { index main.jsp index.html index.htm; proxy_pass http://127.0.0.1:8090; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Via "nginx"; } location ~ /ndf { index main.jsp index.jsp index.htm; proxy_pass http://127.0.0.1:8983; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Via "nginx"; } location ~ /sgtz { index index.jsp index.html index.htm; proxy_pass http://127.0.0.1:8090; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Via "nginx"; } error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } server { listen 80; server_name ques.hotelping.cn; charset UTF-8; include proxy.conf; location / { index index.jsp index.html index.htm; proxy_pass http://127.0.0.1:8080/ques/; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Via "nginx"; } } server { listen 80; server_name apps.hotelping.cn; charset UTF-8; include proxy.conf; location / { index index.jsp index.html index.htm; proxy_pass http://127.0.0.1:8080/apps/; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Via "nginx"; } } # 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 HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} }