How to set up an NGINX web server and remotely access it over Meshnet
Learn how to configure an NGINX web server on Windows, macOS, and Linux and remotely access it using Meshnet.
Last updated
Was this helpful?
Learn how to configure an NGINX web server on Windows, macOS, and Linux and remotely access it using Meshnet.
Last updated
Was this helpful?
Owning a is a dream many people have. Self-hosting a website grants you complete control over its configuration during all development stages and enhances data privacy because the information does not leave your infrastructure.
A tool that is widely used for configuring web servers is . It is free, open-source software that allows you to build and self-host websites. It can also function as a . However, the drawback of such a setup is that, without poking holes in your firewall, the server can only be accessed from the same (LAN). Having a commonly used port exposed to the outside world is dangerous because it can be scanned and probed for vulnerabilities by attackers.
This is where comes to your aid. By using Meshnet, you can have a secure and encrypted tunnel from end devices to your web server without any custom configurations. The website can also be accessed by your friends or family, which you have as your .
Even though the NGINX web server can be run as a , this guide will focus on the standard setup process. You will learn how to configure a simple HTML web server and remotely access it from other devices using Meshnet.
In this part of the article, you can find instructions on how to configure the NGINX web server.
To start setting up the web server, you will need to install NGINX.
Go to the and download the latest mainline version for Windows.
Extract the downloaded archive.
Move the extracted folder to a convenient location — for example, the desktop.
Go inside the NGINX folder, open the conf folder, and locate the nginx.conf file.
Open the nginx.conf file using a text editor, such as Notepad.
Locate the listen
line and ensure that the number next to it is set to 80.
Save changes (File > Save) and exit.
You can control NGINX services by using the command line. Commands allow you to start, stop, and restart NGINX.
Locate the nginx.exe file in the NGINX folder, right-click it, and choose Properties.
Copy its full path, which is displayed next to Location.
In the Command Prompt window, enter cd
and paste in the copied path surrounded by quotation marks.
Example
Now, you can control the nginx.exe file using the Command Prompt.
Type in nginx.exe
and press Enter to start the web server.
To check if the web server started, open an internet browser of your choice and enter localhost
in the URL bar. If the setup is correct, you will be greeted with the default NGINX landing page.
You can make adjustments to the landing page to customize the website to your preference.
In the NGINX folder, open the html folder and locate the index.html file.
Open index.html using a text editor, such as Notepad.
Make any necessary changes to the file using HTML.
Save changes (File > Save) and exit.
In the command prompt, run the following command to reload NGINX with the new configuration:
Lastly, visit localhost
in your web browser once again to see the newly designed website.
Once the web server is up and running, you can reach it remotely via Meshnet from your peer devices.
Copy the NGINX server device's Nord name from the NordVPN application.
Open your internet browser.
Paste the copied Nord name followed by a slash (/) to the URL field and press Enter. Example
If you do not change the to port 80, you will be required to specify the port from the nginx.conf
file when accessing the website.
Open the Windows Command Prompt by pressing the Windows key + R on your keyboard, typing in cmd
, and pressing Enter.
To resolve this problem, and try accessing the website once more.
To install NGINX, you can use the package manager. Install Homebrew by taking these steps:
For additional information about the installation process, refer to .
For :
For :
To resolve this problem, and try accessing the website once more.
If you do not change the to port 80, you will be required to specify the port from the /etc/nginx/sites-available/default
file when accessing the website.
To resolve this problem, and try accessing the website once more.