# -*- nginx -*- log_format wchat_log ' $remote_addr => $host | $request $status | [$time_iso8601] $request_uri $http_user_agent'; upstream wchat_http { server 127.0.0.1:1752; } upstream wchat_socket { server 127.0.0.1:1753; # appserver_ip:ws_port } server { server_name wc.cc; # 192.168.2.6; listen 80 ; index index.htm; root /Users/Can/saver/website/; add_header For "The App"; access_log /Users/Can/Develop/nginx/wchat.txt wchat_log; gzip on; gzip_min_length 10k; gzip_types text/json; location ~ ^/(come|do|feedback|test|statistics|clients) { proxy_pass http://wchat_http; # /$1?$args; proxy_set_header X-Real-IP $remote_addr; add_header IP $remote_addr; } location ~ /(:app|:admin)/.*$ { proxy_pass http://wchat_socket; add_header From "wchat"; proxy_read_timeout 1000d; # 1000 day proxy_send_timeout 1000d; # 1000 day proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } location ~ / { try_files /$uri /$uri.htm /$uri.html /index.htm; add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; } }