worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; ## --------------- nginx as proxy for node based http server -------------------- map $http_upgrade $connection_upgrade { # default upgrade; # '' close; # } # ## --------------- nginx as proxy for gepard based websocket proxy -------------- upstream websocket { # server 127.0.0.1:17502; # WebSocketEventProxy listens here # } # server { ## ------------------- standard port for incoming requests ------------------ listen 80; server_name localhost; location / { ## ------------------- forwarding to HttpSimple ------------------------- proxy_pass http://localhost:8888; # proxy_http_version 1.1; # proxy_set_header X-Forwarded-For proxy_add_x_forwarded_for_by_nginx; # proxy_set_header Host $host; # } location /ws { ## ------------------- forwarding to WebSocketEventProxy ---------------- proxy_pass http://websocket; # proxy_http_version 1.1; # proxy_set_header X-Forwarded-For proxy_add_x_forwarded_for_by_nginx; # proxy_set_header Host $host; # proxy_set_header Upgrade $http_upgrade; # proxy_set_header Connection $connection_upgrade; # } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }