using map and upstream with stream proxy #2384
Replies: 1 comment
-
I have a very similar use case, but with forwarding to an SSH server via 443/https port by using It seems that this is not possible in NPM, because the only option available for incoming ports is via the "scheme" dropdown which has only HTTP or HTTPS options which ultimately map to It would be awesome if there was a way to add custom stream configs directly into a text editor box, and/or be able to specify either listen ports manually, or add addtional "scheme" options other than HTTP/HTTPS to add custom ports to the dropdown list. Sorry to dig up an old post, but I figured I should search before making a new one. Related, this is my page describing how I configured this on a standard nginx install: https://blog.thewalr.us/2019/04/05/using-nginx-stream-directive-to-host-ssh-and-multiple-https-servers-on-the-same-port/ |
Beta Was this translation helpful? Give feedback.
-
Hello,
I use a port 443 stream proxy to mask openvpn servers as https servers. Useful for some WLANs in hotels for example, which allow HTTP/S and mail traffic only. But since I am running multiple openvpn servers on different ports I use map and upstream to redirect incoming traffic according to the server name used. This requires ssl_preread beeing enabled.
Here is an exmaple from my old nginx config:
`map $ssl_preread_server_name $name {
admin.example.com adminvpn;
vpn.example.com vpn;
default https_proxy;
}
// note: I remapped the default https proxy port
upstream https_proxy {
server localhost:8443;
}
upstream vpn {
server localhost:1194;
}
upstream adminvpn {
server localhost:1195;
}
server {
listen 443;
proxy_connect_timeout 300s;
proxy_timeout 300s;
proxy_pass $name;
ssl_preread on;
}`
Would be great If I could do something like that with the webinterface.
Beta Was this translation helpful? Give feedback.
All reactions