Answer the question
In order to leave comments, you need to log in
How to combine using nginx sstp vpn + https backends?
There is nginx with a stream configuration like this:
stream {
map $ssl_preread_server_name $name {
vpn.example.com vpn;
default https;
}
upstream https {
server 127.0.0.1:443;
}
upstream vpn {
server 192.168.23.4:443;
}
server {
listen 192.168.23.101:443;
proxy_pass $name;
ssl_preread on;
# proxy_protocol on;
}
}
server {
listen 127.0.0.1:443 ssl;
server_name site.example.com;
ssl_certificate /root/.acme.sh/*.example.com/fullchain.cer;
ssl_certificate_key /root/.acme.sh/*.example.com/*.example.com.key;
location / {
proxy_pass http://site.local:8080;
}
}
[error] 11270#11270: *384329 recv() failed (104: Connection reset by peer) while proxying and reading from upstream, client: 1.2.3.4, server: 192.168.23.
101:443, upstream: "192.168.23.4:443", bytes from/to client:0/0, bytes from/to upstream:0/225
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question