reverse proxy - websocket example
This commit is contained in:
parent
aae2a71983
commit
481e10d3ef
@ -59,7 +59,7 @@ if [ "$USE_REVERSE_PROXY" = "yes" ] ; then
|
|||||||
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_URL%" "$value"
|
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_URL%" "$value"
|
||||||
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_HOST%" "$host_value"
|
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_HOST%" "$host_value"
|
||||||
if [ "$ws_value" = "yes" ] ; then
|
if [ "$ws_value" = "yes" ] ; then
|
||||||
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_WS%" "proxy_http_version 1.1;\nproxy_set_header Upgrade \$http_upgrade;\nproxy_set_header Connection \$connection_upgrade;\n"
|
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_WS%" "proxy_http_version 1.1;\nproxy_set_header Upgrade \$http_upgrade;\nproxy_set_header Connection \"Upgrade\";\n"
|
||||||
else
|
else
|
||||||
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_WS%" ""
|
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_WS%" ""
|
||||||
fi
|
fi
|
||||||
|
|||||||
30
examples/reverse-proxy-websocket/docker-compose.yml
Normal file
30
examples/reverse-proxy-websocket/docker-compose.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
myreverse:
|
||||||
|
image: bunkerity/bunkerized-nginx:dev
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- 80:8080
|
||||||
|
- 443:8443
|
||||||
|
volumes:
|
||||||
|
- ./letsencrypt:/etc/letsencrypt
|
||||||
|
- ./server-confs:/server-confs:ro # redirect /app1 and /app2 to /app1/ and /app2/
|
||||||
|
environment:
|
||||||
|
- SERVER_NAME=www.website.com # replace with your domain
|
||||||
|
- SERVE_FILES=no
|
||||||
|
- DISABLE_DEFAULT_SERVER=yes
|
||||||
|
- REDIRECT_HTTP_TO_HTTPS=yes
|
||||||
|
- AUTO_LETS_ENCRYPT=yes
|
||||||
|
- USE_PROXY_CACHE=yes
|
||||||
|
- USE_GZIP=yes
|
||||||
|
- USE_BROTLI=yes
|
||||||
|
- USE_REVERSE_PROXY=yes
|
||||||
|
- REVERSE_PROXY_URL=/ws/
|
||||||
|
- REVERSE_PROXY_HOST=http://myws:8010/
|
||||||
|
- REVERSE_PROXY_WS=yes
|
||||||
|
|
||||||
|
myws:
|
||||||
|
image: ksdn117/web-socket-test
|
||||||
|
restart: always
|
||||||
Loading…
x
Reference in New Issue
Block a user