Joentje / nordvpn-proxy

Use NordVPN in your Docker stack
141 stars 53 forks source link

Got a problem trying to access this externally #79

Open nicholasyoannou opened 2 years ago

nicholasyoannou commented 2 years ago

Just a general issue: trying to access this externally (trying to connect IP:8118), but it's not connecting - even opening the port via UFW (am using Ubuntu Linux) doesn't do anything.

Tried using NGINX as a reverse proxy, and the webpage is returned, but using: IP, port as 80/443 (due to NGINX reverse proxy, can't use 8118 as that's already taken by the Docker instance), that returns 400 Bad Request.

But when I do SSH tunnelling to open the port, the proxy works just fine. But I don't want to do SSH tunnelling in production due to personal reasons, so how would I go about if I used NGINX/some way of opening up my firewall to 8118?

nicholasyoannou commented 2 years ago

Figured it out! Thanks to a comment from Solaflex, #60 , was able to figure out the problem. Turns out you just needed to edit the privoxy config and remove 0.0.0.0 from it.

Step by step

  1. Go into Docker instance (docker ps -a to find container ID, docker exec -u 0 -it [container ID] /bin/sh to go into it)
  2. Edit /etc/privoxy/config and find listen-address, removing the default 0.0.0.0. There's also another privoxy config in /app/privoxy/config
  3. Restart the docker instance with docker restart [container ID]. Pretty much it! Then you can just ....whitelist it in UFW as per normal.
nicholasyoannou commented 2 years ago

Actually, got one new problem. Seems I mucked up the ports when I was setting it up. It worked temporarily but stopped working. After I did a bit of a fiddle with it, I found that executing docker port for my container got me two ports:

9993/tcp -> 0.0.0.0:9993
9993/tcp -> :::9993

(yea, I changed the ports instead to 9993 instead of the original due to what is already on that port on my machine)

nicholasyoannou commented 2 years ago

If this is why, how do I manage the ports so it's just one or the other, and which one would I remove?

nicholasyoannou commented 2 years ago

Tue Jul 5 08:01:09 2022 ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2) Am now getting this error.

nicholasyoannou commented 2 years ago

Fixed the tunnel issue myself. It's just ....when I connect to the VPN, privoxy doesn't expose the port outside of the machine, only kept within localhost. Whereas when the VPN isn't connected, privoxy works out the machine. Not sure how I'd go about fixing this