From 1423787b6076daeb18176e907b1ed307255ffbcb Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 13 Sep 2018 13:08:37 -0400 Subject: [PATCH] LP#1711145 NGINX sample websocketd configs Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- examples/nginx/osrf-ws-http-proxy | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/examples/nginx/osrf-ws-http-proxy b/examples/nginx/osrf-ws-http-proxy index 622e8ea..db2e6e2 100644 --- a/examples/nginx/osrf-ws-http-proxy +++ b/examples/nginx/osrf-ws-http-proxy @@ -63,7 +63,16 @@ server { } location /osrf-websocket-translator { + + # apache2-websockets: + # Defaults to HTTPS with or without a proxy. proxy_pass https://localhost:7682; + + # websocketd: + # websocketd may be run with or without SSL. When used with + # NGINX, the assumption is it runs w/o SSL. Change to taste. + #proxy_pass http://localhost:7682; + proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -72,12 +81,20 @@ server { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; - # Raise the default nginx proxy timeout values to an arbitrarily - # high value so that we can leverage osrf-websocket-translator's - # timeout settings. proxy_connect_timeout 5m; + + # apache2-websockets: + # Raise the default nginx proxy timeout settings to + # an arbitrarily high value so that we can leverage + # osrf-websocket-translator's native timeout settings. proxy_send_timeout 1h; proxy_read_timeout 1h; + + # websocketd: + # websocketd connections persist indefinitely. Leverage nginx + # timeouts to periodically disconnect long-idle clients. + #proxy_send_timeout 5m; + #proxy_read_timeout 5m; } } -- 2.11.0