today we are going to look at how to set up Nginx Proxy Manager on a Synology NAS .

If you ’ re exposing any services on your network, using a reverse proxy is a bang-up way to increase security and performance. A change by reversal proxy is a server that sits in front of your web servers and forwards customer requests to the world wide web servers. In layman ’ south terms, you only have to expose one waiter ( using ports 80/443 ) and will be able to expose as many web services as you want.

This is an model of the network menstruate of a reverse proxy ( simplified ) :
Please keep in mind that this is an alternative to Synology’s Application Portal where you can set up a Reverse Proxy. If your intentions are to only create a reverse proxy, you might want to use that instead, as there is no configuration necessary (other than the reverse proxy settings)!

1. Setup Instructions – Nginx Proxy Manager Synology NAS

This tutorial will utilize a Synology NAS and Docker. Since Nginx Proxy Manager uses a database, we will need to install two unlike containers. One for our database and one for Nginx Proxy Manager. By default, Synology uses ports 80 and 443 therefore using our server network interface international relations and security network ’ thyroxine ideal. For this reason, we will create a macvlan network interface ( in Docker ) that will allow us to bypass this port conflict .
1. Install Docker from Synology ’ s Package Center .
2. We need to create a few folders that we will be mapping our Docker containers. By nonpayment, the Docker box will create a booklet named stevedore after it ’ s finished install. Inside of this folder, we are going to create a folder named mariadb and nginx-proxy .
nginx proxy manager synology
3. Inside of the nginx-proxy booklet, create two sub-folders named data and letsencrypt .
nginx proxy manager synology
4. Create and upload a file named config.json to the nginx-proxy folder. This file must contain the contents below. Ensure that you change SYNOLOGY_NAS_IP to the IP Address of your Synology NAS!

   "database": {
   "engine": "mysql",
   "host": " SYNOLOGY_NAS_IP",
   "name": "nginxproxymanager",
   "user": "nginxproxymanager",
   "password": "nginxproxymanager",
   "port": 3306

5. The folder setup is complete !

1.1 Macvlan & Bridge Docker Network Interface Setup

1. guarantee you can SSH into your Synology NAS. Open Control Panel, choose Terminal & SNMP, and Enable SSH service. If you are using Synology’s Firewall, ensure that you allow port 22 traffic. I created a video on how to SSH into your Synology NAS if you have any problems .
2. SSH into your Synology NAS using your favorite SSH creature .
3. We need to create a Docker macvlan network interface. First, we need to determine what network interfaces presently exist ( on your Synology NAS ) and note down the arranger name. To do this, run the command below and note down the network interface name that has your Synology NAS ’ s IP address ( in this example, mine is eth0 ) .


nginx proxy manager synology
4. next, you need to run the instruction below while substituting the correct subnet ( most are or by default ). You besides need to pick an IP savoir-faire that you ’ d like to use that ’ s not presently in practice. I will be using NOTE : npm_network will be the identify of the network ( you can substitute this as you ’ d like ) .

sudo docker network create -d macvlan -o parent=eth0 --subnet= --gateway= --ip-range= npm_network

nginx proxy manager synology
5. Our network is nowadays created. We can now exit our SSH session and disable it in DSM ( if you won ’ triiodothyronine be using it ). If you are disabling it and created a firewall rule for it, you should inactivate the firewall rule as well .
6. next, we need to create a bridge network. This is what will allow our server ( NAS ) to communicate with our Nginx Proxy Manager container. open Docker and voyage to the Network section. Select Add and enter a subnet that ’ s not presently in practice. The IP savoir-faire of the bridge I am creating will be .
nginx proxy manager synology
7. Both net interfaces have now been set up !

1.2 MariaDB Install and Configuration

Nginx Proxy Manager requires a database to be set up in order for it to work by rights. While Synology offers a MariaDB software, I like to separate it out by creating a second Docker container for the database entirely .
1. open Docker, navigate to the Registry, and search for MariaDB. Download the latest version of MariaDB .
nginx proxy manager synology
2. After the image has finished download, voyage to the Image segment, and double cluck mariadb to set up a new container .
3. Give the container a mention and then select Advanced Settings .
nginx proxy manager synology
4. blue-ribbon Enable auto-restart .
nginx proxy manager synology
5. In the Volume part, choose Add Folder and then select the mariadb folder we created earlier. In the Mount Path part, character /var/lib/mysql .
npm syn8

6. In the Port Settings incision, change the Local Port to 3306. NOTE : If you have to use something other than 3306 as the port, you need to update the config.json charge we created earlier .
npm syn8.1
7. In the Environment segment, we need to create four variables. These variables are what will store our rout password, database diagnose, username, and password. NOTE : if you don’t want to use the values below (nginxproxymanager), you can change this to whatever you’d like. Just ensure that you update the config.json file that we created earlier with the new information.
npm syn9
8. Select Apply and create the container. The database has now been created !

1.3 Firewall Setup – Nginx Proxy Manager Synology NAS

Since we are using a macvlan network interface, there are no firewall rules that we need to set up for Nginx Proxy Manager. however, the MariaDB container is using the host network interface and for that reason, needs a firewall convention to allow traffic. If you haven ’ triiodothyronine set up Synology ’ s firewall, I created a tutorial on how you can do it ( and suggest that you do ) .
1. Open the Control Panel, choice Security, then Firewall. Select Edit Rules and add an allow rule for port 3306. NOTE : If you are using a different port in the config.json file that we created above, you will need to use that port rather of 3306 .
npm syn17

1.4 Nginx Proxy Manager Container Setup – Synology NAS

1. open Docker, navigate to the Registry, and search for nginx-proxy-manager. Download the latest interpretation of jc21/nginx-proxy-manager .
nginx proxy manager synology
2. After the visualize has finished download, navigate to the Image section and double cluck jc21/nginx-proxy-manager to set up a new container .
nginx proxy manager synology
3. Give the container a name and choice Advanced Settings .
nginx proxy manager synology
4. choice Enable auto-restart .
nginx proxy manager synology
5. In the Volume section, we need to create two folder mappings and one file map. Select Add Folder and add the data booklet and add the backing path /data. Next, select the letsencrypt booklet and add the mount path /etc/letsencrypt. Select Add File and select the config.json file we created earlier with the ride path /app/config/production.json .
npm syn14
6. Under Network, add the npm_network and npm_bridge networks and remove bridge .
npm syn15
7. Match the Port Settings to be like the trope below. If you are using 4443, 8080, or 8081 for anything, you can change the ports to something not presently being used .
npm syn16
8. Select Apply and create the container ! Give the container a few minutes and you should be able to access the web admin portal vein through the npm_network IP address and port 81 !


2. Nginx Proxy Manager Setup – Synology NAS

1. Login with the e-mail address [email protected] and password changeme .
nginx proxy manager synology
2. When motivate, change your identify and electronic mail address, then set up your password .
3. Nginx Proxy Manager is now set up ! guarantee that you port ahead ports 80 and 443 on your router to the macvlan net we created above .
certain people are experiencing “ bad gateway ” errors when they try and login. After troubleshooting this for a while ( and a few helpful suggestions in the comments ), there are actually two ways to fix this :
1. If your NAS has multiple NIC ’ randomness and you have multiple IP addresses assigned to it, in the “ config.json ” file, enter the early IP address of your NAS .
2. Keep the default stevedore bridge net interface connected to both containers and use that IP address in the config.json file .

3. Using Nginx Proxy Manager

now that we set up Nginx Proxy Manager, it ’ south significant to know how to use it ! I created a tutorial that you can follow that will show you how to expose Plex and setup an SSL certificate. The tutorial is reasonably straight ahead, but highlights how you can expose practically any network server quickly, well, and securely !

4. conclusion

This was a reasonably complex tutorial, but I am hoping that it ’ s broken down enough to be easily understand. It ’ s not normal that you need to set up two different Docker containers to get one container to work, but in my opinion, this is the best way to get Nginx Proxy Manager working on a Synology NAS .
Thank you for reading the tutorial. If you have any questions, please leave them in the comments !
Please contribution if this helped you !

reference :
Category : Website hosting

Leave a Reply

Your email address will not be published.