notes/IT/Making nginx forward VPN and https traffic on tcp 443.md

24 lines
748 B
Markdown
Raw Normal View History

2024-05-19 15:41:53 +00:00
This file documents my troubleshooting methodology for configuring nginx to reverse proxy https traffic, and reverse proxy non https traffic on tcp/443.
2024-05-19 15:47:53 +00:00
## Context
I would like to serve https traffic from a server (`192.168.0.6`),
2024-05-19 15:43:53 +00:00
Right now, it appears that I can't do that with one IP because that would require two separate nginx components listening on the same port, or that's what I ascertained from the logs.
2024-05-19 15:44:53 +00:00
I modified `/etc/nginx/nginx.conf` to include this block underneath the `http` block:
```nginx
2024-05-19 15:46:53 +00:00
stream {
server {
listen 443;
proxy_pass 192.168.0.2:443;
}
}
2024-05-19 15:44:53 +00:00
```
2024-05-19 15:43:53 +00:00
2024-05-19 15:47:53 +00:00
When trying to start with that change applied, I got the error:
```
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
```
2024-05-19 15:41:53 +00:00
## IP Aliasing