S
S
shvedoffsky2018-11-29 18:43:16
Nginx
shvedoffsky, 2018-11-29 18:43:16

nginx proxying for non-standard services?

Good afternoon!
I do not quite understand how proxying to a virtual machine should take place.
I have a server with a static ip on it, nginx is raised in proxy mode (single entry point)
Virtual machines are spinning on the server, services (qbittorrent, homeassistant, etc.)
are running on them (qbittorrent, homeassistant, etc.) services are available.
The problem is that, let's say qbittorrent has the ability to specify local network addresses and you can log in without entering a username and password, so when I log in from the local network everything works like that, but when I log in from outside, the password and login are also not asked , i.e. nginx passes its address when proxying, not the real address of the client.
How to set up proxying with the transfer of a real address for such a type of service as qbittorrent?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TyzhSysAdmin, 2018-11-29
@POS_troi

You forgot to attach the nginx config.
Well, in the simplest config, the client IP address will be the IP address of the host with Nginx, and this is your internal network.
You need to pass the correct headers to the resource.

location / {
    proxy_set_header  Host $host;
    proxy_set_header  X-Real-IP $remote_addr;
    proxy_set_header  X-Forwarded-For $remote_addr;
    proxy_set_header  X-Forwarded-Host $remote_addr;
    proxy_pass        http://0.0.0.0;
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question