Skip to content

Create subdomain to NGINX

First, we want to build a proxy host for our NGINX manager so that we can access our manager via the subdomain proxy.yourdomain.com.

We have already made some settings in advance, including forwarding ports 443 and port 80 to our proxy.

And now we have to do everything else for the creation. So let’s get started

Create DNS Record (Domain-Provider)

First, we create a DNS record for our first subdomain with our website provider.
Since I run my domain via Cloudflare, I will also create my first DNS record there.

  • Open your DNS-Record-Area
  • Create the record with the following values
  • Save and Apply

A

Open and Login to the webinterface

via tailscale ip (my choice)

Now you can access the web interface of your proxy manager with your browser.

http://opnsense_tailscale_ip:81

via public ip

Now you can access the web interface of your proxy manager with your browser.

http://yourip:81

Create Proxy host

  • Go to Hosts > Proxy Hosts
  • Click green Add Proxy Host-Button
  • Now enter the following values
  • Click Safe-button

Proxysettings

Domain Names - proxy.yourdomain.com
Scheme - http
Forward Hostname / IP - 127.0.0.1 or localhost
Forward port - 81
Cache Assets - false
Block Common Exploits - false
Websockets Support - true
Access List - “Publicly Accessible”

If the host you have just created has the status "Online", everything has worked and you can reach your proxy manager at proxy.yourdomain.com. Now we should delete the temporarily created NAT rule from port 81.

Connecting to OPNsense-WebUI

We would like to create a temporary firewall rule to access the WebUI via port 81. To do this, first open opnsense via your SSH-Tunnel.

  • Open Windows Terminal
  • Use the command: ssh root@<yourIP4> -L 443:<WAN_IP4>:9443

This will open up a tunnel. After that you should be able to connect via https://localhost. To setup everything important I recommend running the setup wizard.
It will configure some important things needed for further configuration

Delete NAT-Rule with Port 81

  • Go to Firewall > NAT > Port Forward
  • Delete the Rule by clicking the Trash-button
  • Hit ‘Yes’ and then ‘apply’