D
D
Dasha Tsiklauri2020-04-23 18:07:02
Nginx
Dasha Tsiklauri, 2020-04-23 18:07:02

Restarting Nginx without dropping WebSocket connections, really?

There are the following inputs:
CloudFlare
Docker Swarm cluster
Nginx as a reverse proxy
Go-app with web sockets

There are several domains in the Nginx config , domains have to be added. After editing the configs , I restart the Nginx service , since I am rebuilding the image. After restart ws-connections are torn . Are there any ways to resolve the issue on the server side by reloading the Nginx config without breaking WebSocket connections? Don't suggest ways to implement this on the client



Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Sundukov, 2020-04-23
@dasha_programmist

Why restart nginx and not reload?

V
Vitaly Karasik, 2020-04-23
@vitaly_il1

After editing the configs, I restart the Nginx service, as I rebuild the image.

As far as I understand, this is unrealistic, and the only option is to use several Nginx instances and update them one by one: I marked Nginx as inactive, waited until all sessions ended, updated. Etc.
How easy it is to do this in Docker Swarm, I don't know.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question