Score:0

Nginx proxy reverse multiple ports by url

um flag

I need to config nginx reverse proxy to listen 443 port and redirect to localhost and port from url address. Https://example.com/test/1234 Redirect to 127.0.0.1:1234 And it means client choose port on local host by writing in url.

Lex Li avatar
vn flag
Why do you want to redirect (HTTP 30x) to `127.0.0.1:1234`? The people browsing `https://example.com/test/1234` might not have a web server/web app running at `127.0.0.1:1234` on their machines.
Ehsan Hosseini avatar
um flag
Actually I have vpn runing on my server and every user have a port on my vpn server.so the client vpn app request on port 443 and its request url contains port number. I want nginx redirects its request to servers port which he requested.
Lex Li avatar
vn flag
When your VPN server opens that port, does it allow local traffic only (binding to 127.0.0.1)? Or external traffic is also acceptable? You cannot redirect if the VPN server only expects local traffic, and in that case `proxy_pass` is required like crpb commented.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.