How to assign custom host names to Meshnet services using Nginx proxy manager
Learn how to use the Nginx proxy manager to create custom host names for Meshnet services.
Last updated
Was this helpful?
Learn how to use the Nginx proxy manager to create custom host names for Meshnet services.
Last updated
Was this helpful?
As the popularity of self-hosted services continues to grow, so does the challenge of managing multiple IP addresses, host names, and port numbers. It can quickly become overwhelming to keep track of which port number to enter for services like , , or .
While a custom can help overcome the problem of remembering the IP addresses or host names of your peer devices, it's not enough to handle requests that need to be forwarded to a specific port number. This is where a , such as the (NPM), can come in handy. With NPM, you can easily create reverse proxies without needing prior networking knowledge. By combining a custom DNS server with NPM, you can eliminate the need to remember and enter port numbers altogether.
This article showcases the process of setting up the Nginx proxy manager alongside a DNS server to create custom host names for your services, simplifying their management.
Before you begin the setup process, make sure that:
You have and installed on your system.
You have a custom DNS server set up on your network. For example, .
You have changed the DNS addresses of your devices to your custom DNS server.
Port 80 is not in use by any service on your system.
To start, you need a way to create DNS rewrites from a custom host name to a specific IP or host name. While this can be achieved by editing your operating system’s hosts
file, a much more convenient and easily manageable alternative is a custom DNS server.
To create a DNS rewrite using AdGuard Home:
Open your AdGuard Home web interface.
From the menu bar, select Filters > DNS rewrites.
Click Add DNS rewrite.
In the pop-up window, fill in the following information:
In the upper field, enter a custom host name that you want to use to access a specific service.
In the lower field, enter localhost
.
Example
Click Save.
You should now see a new entry in the DNS rewrites table. Repeat this procedure for any other host names you want to create.
Tip
With the DNS rewrites created, you can deploy your Nginx proxy manager instance. To set up NPM, you need to use Docker Compose.
Open PowerShell.
Create a new folder called nginx-proxy-manager
and navigate to it using this command:
Create a docker-compose.yml
file and open it using Notepad with the following command:
In the Notepad window, paste the following information that specifies the NPM docker image, publishes the required ports, and creates two new folders in your working directory.
Press Ctrl + S to save changes.
Exit Notepad.
With the Compose file created, while in the nginx-proxy-manager
directory, execute the following command in the command line to create your NPM instance:
Once the container is active, you can visit the NPM web interface.
Open your internet browser.
In the URL bar, enter localhost:81/
and press Enter.
Log in using the default email (admin@example.com
) and password (changeme
).
After logging in, you will be asked to change the details of your account. Follow the on-screen instructions to update your credentials.
Finally, you can create a proxy redirect for your created host name to reach a specific service.
From the NPM dashboard, select Proxy hosts.
Click Add proxy host.
In the new window, specify the following information:
In the Forward hostname / IP field, type in the Nord name or the Meshnet IP address of your Meshnet peer device.
In the Forward port field, enter a port number that the peer device’s service is using. Example
Click Save.
You should see a new entry for your proxy appear in the Proxy hosts table.
Now you can access your Meshnet services without needing to specify the Nord name or the port that you want to reach. Simply enter the custom host name into the search field of your internet browser and your specified service will open.
AdGuard Home supports . You can use the format *.example.com
to redirect all subdomains of example.com
. This way, you don’t have to add new DNS entries for each service.
First, you need to create a containing instructions for NPM.
Docker will from Docker Hub and create the container.
In the Domain names field, enter the custom host name you created in the section.