W
W
wargych2019-05-26 18:47:37
Nginx
wargych, 2019-05-26 18:47:37

Gorilla websockets under nginx + ssl - how to do it?

There is a site that has nginx at the entrance, which proxies requests, depending on the url, either to the goroutine server with the application, or to wordpress.
The goroutine also has a websocket. The configuration worked quite well until the installation of ssl on nginx, after installation it does not function (which is generally expected).
Proxying is carried out as follows:

location = /ws {
            proxy_pass http://localhost:9000;
            proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
        }

Question: where to dig and where to edit - at the level of the nginx config, or do I need to get into the code on go?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pavlyuk, 2019-05-26
@wargych

What websocket address is used on the client? If you have https on the server, then the address must begin with wss://, not ws://

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question