nginx-cn/conf/bits/wsproxy_params
Lily Tsuru 35b09db127 Add basic configuration extracted from our running config
Cleaned of most stuff *from* our config, but a template is provided to help you get started.
2024-03-23 03:58:50 -04:00

54 lines
1.6 KiB
Plaintext

# wsproxy_params: Include file for configuring a location
# to proxy a upstream with WebSocket support.
# This file effectively makes WebSocket proxying 2 lines long.
proxy_http_version 1.1;
# ignore headers that could be used to alter how we handle
# none of our proxied servers do this, but
proxy_ignore_headers X-Accel-Redirect X-Accel-Buffering;
# No buffering or redirect
#proxy_buffering off;
proxy_redirect off;
# experiemnt: do use buffering and
# use smaller buffer sizes
proxy_buffering off;
#proxy_buffer_size 4k;
#proxy_buffers 8 4k;
#proxy_buffer_size 128k;
#proxy_buffers 100 128k;
#proxy_set_header Host $host:$server_port;
proxy_set_header Upgrade $http_upgrade;
# TODO: this might be problemeatic, change this to $http_connection, or
# the map in documentation.
proxy_set_header Connection $connection_upgrade;
# pass standard Websocket handshake headers
proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;
proxy_set_header Sec-WebSocket-Protocol $http_sec_websocket_protocol;
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # CHANGE use second if your server will be under cloudflare
#proxy_set_header X-Forwarded-For $http_cf_connecting_ip;
# I'd readd this, but to be kinda brutally honest,
# this causes more issues than it really solves.
#proxy_read_timeout 36000s;
# hopefully this works?
proxy_connect_timeout 10s;
# Most of our stuff will disconnect you if you don't send anything in a reasonable
# time frame, so this should be okay.
#proxy_read_timeout 36000s;
#proxy_read_timeout 960s;
proxy_send_timeout 480s;