A
A
Andrey Mensky2017-03-17 16:05:31
Nginx
Andrey Mensky, 2017-03-17 16:05:31

How to pass real client IP through nginx in TCP proxy mode?

Good afternoon, I ran into a problem.
There is a websocket server on Node.JS, in front of it is nginx in the streaming TCP proxy mode. Actually, the problem is that in this proxy mode I can’t (or don’t know how) to pass ip through headers.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Andrey Mensky, 2017-03-23
@men232

And so, at random, it was found that the reason for the behavior of nginx is unclear. But it is solved by changing the nginx port to any other from (80, 8080).
This is the working config for me:

server {
    listen 4646;
    server_name myhost.org;

    location /ws {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;

        proxy_pass http://backend_ws;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

U
Ulyan Romanov, 2018-01-08
@TexxTyRe

AOS
Or try Popmotion (haven't tried it myself yet)
PS: stop asking for something in Russian. Even Russians with experience in programming will still write documentation in English. If you want everything in Russian, then 1C is a great solution.

A
Anton Filippov, 2018-01-09
@vicodin

scrollmagic.io _

V
Vladimir Proskurin, 2018-01-09
@Vlad_IT

I'm using onscreen.js (there's also a jQuery version ). I just add a class to them, for example visible, and through css I already set the animation. It's also very convenient to work with animation.css by simply adding its classes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question