Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Using OpenVPN behind an NGINX Reverse Proxy using the TCP/UDP Stream Proxying Module

$
0
0
I have been using NGINX as a reverse proxy for my home domain for a little over a year now. The proxy lives in an AWS EC2 instance and delivers traffic to my home IP Address and disguises all of the ugly port combinations.

I've never managed to get my OpenVPN server to work with NGINX though. When I try and connect to the server from BEHIND NGINX via my domain name, it times out and says:

TCP: connect to [AF_INET]777:777:777:777:8050 failed, will try again in 5 seconds: Connection timed out

Where `777.777.777.777` is the IP Address of my reverse proxy NOT my home IP Address which is `888.888.888.888`. Which NGINX should be stream proxying data to as defined by this block in my config file: https://gist.github.com/zimmertr/fc197a5cab1089f1468848ae7f86a3f2

Now, from what I can tell, I have configured NGINX properly. And, I know for a fact that I have configured the everything correct on the VPN/Home networking side as if I configure the OpenVPN server to use the IP Address of my home server is works fine: http://i.imgur.com/UycWpOO.png

`[OpenVPN Server] Peer Connection Initiated with [AF_INET]888.888.888.888:8051`

If that field is changed from `888.888.888.888` to `vpn.domain.com` instead, which uses the NGINX reverse proxy, then data isn't redirect to the proper IP Address. And instead OpenVPN attempts to connect to ports 8050 and 8051 on the AWS EC2 instance running NGINX.

Have I done something wrong? Is this not the intended purpose of stream proxying? Looking forward to hearing back from you guys. Thanks for the help!

EDIT: If it's not immediately obvious, I redacted my actual IPs. Which is why I used those invalid IPs.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>