Skip to content

Commit 404d4d4

Browse files
committed
Edit websocket configuration
Add proxy configuration to proxy requests from /ws to a websocket server listening on port 4321 in the host (172.17.0.1) (https://dev.to/natterstefan/docker-tip-how-to-get-host-s-ip-address-inside-a-docker-container-5anh)
1 parent 06c90c4 commit 404d4d4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

default.conf

+5-2
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,14 @@ server {
7979
}
8080

8181
location /ws {
82-
proxy_pass http://127.0.0.1:4321;
82+
proxy_pass http://172.17.0.1:4321;
83+
proxy_http_version 1.1;
84+
proxy_set_header Upgrade $http_upgrade;
85+
proxy_set_header Connection "upgrade";
8386
include /etc/nginx/shared/proxy.conf;
84-
8587
}
8688

89+
8790
location /metrics {
8891
auth_basic "Metrics";
8992
auth_basic_user_file /etc/nginx/shared/htpasswd;

0 commit comments

Comments
 (0)