Welcome! Log In Create A New Profile

Advanced

Port restore problem of reverse proxy after login.

Hongyi Zhao
November 06, 2021 03:26AM
I've nginx installed on my Ubuntu based VPS with the domain name
my.domain.xyz. A socks5 proxy listening on port 6001 of the VPS which
can access the intranet website 10.8.10.220:2021. Now, I run socat as
following on the VPS:

$ socat -v -d -d TCP4-LISTEN:2021,fork,reuseaddr
socks5:127.0.0.1:10.8.10.220:2021,socks5port=6001

Then I configure a reverse nginx proxy as follows:

server {
listen 8888;
location / {
proxy_pass http://localhost:2021;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

The above configuration will let me access the intranet website
10.8.10.220:2021 from outside with the following URL:
http://my.domain.xyz:8888.

The intranet website 10.8.10.220:2021 need login with specific
username and password. After I open http://my.domain.xyz:8888 and then
do the login, the URL always changes to the following form:

http://my.domain.xyz:2021

This will cause subsequent operations to fail. Is there any way to
continue using port 8888 to solve this problem?

Regards,
HZ
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Port restore problem of reverse proxy after login.

Hongyi Zhao November 06, 2021 03:26AM

RE: Port restore problem of reverse proxy after login.

Reinis Rozitis November 06, 2021 04:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 245
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready