# -*- nginx -*- log_format cool_log ' Cool! $remote_addr => $host | $request $status | [$time_iso8601] $request_uri $http_user_agent'; upstream cool_socket { server 127.0.0.1:3001; # appserver_ip:ws_port } upstream cool_http { server 127.0.0.1:3000; } server { server_name ~cool cool.com; listen 80; root /Users/Can/school/static; index index.htm; listen 443 ssl; ssl_certificate /Users/Can/Projects/shopping/else/config/server.crt; ssl_certificate_key /Users/Can/Projects/shopping/else/config/server.key; ssl_prefer_server_ciphers on; location ~ /(-|\+|api)/(?.*) { access_log /Users/Can/Develop/nginx/cool.log.txt cool_log; proxy_pass http://cool_http/$api; add_header IP $remote_addr; add_header For CoolServer; add_header X-Forwarde-For $proxy_add_x_forwarded_for; } location ~ /:cool/.*$ { proxy_pass http://cool_socket; add_header From "WebSocketServer"; 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 /lib { add_header Cache-Control "max-age=300000"; } location ~ ^/[^.]*$ { try_files /index.htm 404; } location ~ ^/(?!(lib)) { # MUST write in the end!! # kill cache # add_header Last-Modified $date_gmt; # add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; # if_modified_since off; add_header Cache-Control "max-age=0"; expires off; etag off; } }