0

I have an Nginx server running on my local network, and I want to make it accessible from the internet via an OpenVPN connection. Here are the details of my setup:

  • Ubuntu Server Local IP Address: 192.168.29.110

  • OpenVPN Access Server IP Address: 139.59.60.64

Notes:

  1. OpenVPN Access Server is running on a DigitalOcean Ubuntu Server (called OpenVPN-server hereon)
  2. Nginx is running on a local Ubuntu Server at home (called Nginx-server hereon)
  3. Home network (ISP) doesn't allow dedicated IP / port forwarding due to which I'm unable to access my Nginx-server from outside the LAN network. Therefore the goal is to connect local Nginx-server to OpenVPN-server so as to use the IP address of the VPN connected and thereby allow Nginx-server to be accessible from the word wide web (public internet).
  4. UFW is disabled on both OpenVPN-server as well as Nginx-server.
  5. DigitalOcean firewall is disabled.

Network Configuration on Nginx-server: Netplan configuration (/etc/netplan/01-netcfg.yaml):

network:
  ethernets:
    eno1:
      addresses:
      - 192.168.29.110/24
      nameservers:
        addresses:
        - 8.8.8.8
        search: []
      routes:
      - to: default
        via: 192.168.29.1
  version: 2

Nginx Configuration on Nginx-server: Nginx configuration file (/etc/nginx/sites-available/default):

server {
    listen 80;
    listen [::]:80;

    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;

    server_name 139.59.60.64;

    location / {
        proxy_pass http://192.168.29.110;  # Update this line
        include proxy_params;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

Challenges and Questions:

  1. Replacing OpenVPN Dashboard with Nginx Landing Page:
  • I currently access the OpenVPN Access Server dashboard from the IP address 139.59.60.64. After establishing a connection from Nginx-server to the OpenVPN-server, I want to replace the dashboard with my local Nginx landing page. How can I achieve this?
  1. Making Nginx Accessible from the Internet via OpenVPN:
  • After connecting to the OpenVPN-server, what changes do I need to make in my Nginx configuration file and Netplan configuration on Nginx-server to access my Nginx-server from the internet?
1
  • You also need some routing on top of the VPN so I would suggest a gateway like opnsense
    – Turdie
    Commented Feb 21 at 0:37

1 Answer 1

0

You probably need to create a static route to route the vpn network, where the devices are in who connect over the vpn. to the host network.

And you need to make sure that the vpn ports and traffic are allowed.

To make sure that the nginx pages are served you need to make sure that nginx runs on port 80/443 and has a couple of vhosts to serve content. Probably the openvpn access server has its own webserver

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .