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.
Asked
Active
Viewed 687 times
127.0.0.1:1234? The people browsinghttps://example.com/test/1234might not have a web server/web app running at127.0.0.1:1234on their machines. – Lex Li Jan 03 '23 at 03:47location ~ ^/test/([0-9]{4}?)(/.*)?$ { proxy_pass http://127.0.0.1:$1/$2; }i would guess without testing it. And i just searched and think that would still go wrong with this in mind. – Jan 03 '23 at 10:43proxy_passis required like crpb commented. – Lex Li Jan 03 '23 at 18:20