{"id":111260,"date":"2024-04-22T21:01:31","date_gmt":"2024-04-22T21:01:31","guid":{"rendered":"https:\/\/linuxiac.com\/?p=111260"},"modified":"2024-10-16T11:42:08","modified_gmt":"2024-10-16T11:42:08","slug":"how-to-set-up-reverse-proxy-with-nginx-proxy-manager","status":"publish","type":"post","link":"https:\/\/linuxiac.com\/how-to-set-up-reverse-proxy-with-nginx-proxy-manager\/","title":{"rendered":"How to Set Up Reverse Proxy with Nginx Proxy Manager (NPM)"},"content":{"rendered":"\n<p>Nginx Proxy Manager (NPM) is an easy-to-use tool for managing reverse proxy configurations. Essentially, it acts as a user-friendly interface for the high-performance Nginx web server and also uses <a href=\"https:\/\/linuxiac.com\/lets-encrypt-free-ssl-certificate\/\">Let&#8217;s Encrypt<\/a> in the background to <a href=\"https:\/\/linuxiac.com\/zerossl-how-to-install-ssl-certificate\/\">issue free SSL certificates<\/a>, thus providing HTTPS connectivity to proxied services.<\/p>\n\n\n\n<p>Compared to other reverse proxy solutions like Nginx, Caddy, or Traefik, the main NPM&#8217;s appeal lies in its ability to provide a convenient graphical user interface for managing proxy settings, SSL\/TLS certificates, and access controls, making it accessible even to those with minimal command-line experience.<\/p>\n\n\n\n<p>However, if you want to try other reverse proxy options, you can count on our easy-to-follow guides for <a href=\"https:\/\/linuxiac.com\/reverse-proxy-with-nginx\/\">Nginx<\/a> and <a href=\"https:\/\/linuxiac.com\/how-to-set-up-caddy-as-reverse-proxy\/\">Caddy<\/a>. Now, back to the topic. Here are the main selling points of Nginx Proxy Manager.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-use-npm-as-a-reverse-proxy\">Why Use NPM as a Reverse Proxy?<\/h2>\n\n\n\n<p>Using Nginx Proxy Manager as a reverse proxy can provide several advantages:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Easy-to-Use:<\/strong> Even if you&#8217;re not very technical, you can set up a fully functional reverse proxy in just 20-30 minutes.<\/li>\n\n\n\n<li><strong>Security:<\/strong> It can hide the characteristics and details of backend servers, offering an additional layer of security.<\/li>\n\n\n\n<li><strong>Load Balancing:<\/strong> NPM can distribute traffic across multiple servers, enhancing the performance and reliability of web applications.<\/li>\n\n\n\n<li><strong>SSL Management:<\/strong> Automatic and easy SSL setup and renewal processes for encrypted traffic, improving website security with HTTPS.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-explaining-our-setup\">Explaining Our Setup<\/h2>\n\n\n\n<p>NPM runs in a Docker container. Because of this, ensure you have a server with Docker installed. But don&#8217;t worry if you don&#8217;t have it yet; we&#8217;ve got you covered. Our guides on installing Docker on almost all major Linux distributions, such as <a href=\"https:\/\/linuxiac.com\/how-to-install-docker-desktop-on-ubuntu-24-04-lts\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ubuntu<\/a>, <a href=\"https:\/\/linuxiac.com\/how-to-install-docker-on-debian-12-bookworm\/\" target=\"_blank\" rel=\"noreferrer noopener\">Debian<\/a>, <a href=\"https:\/\/linuxiac.com\/how-to-install-docker-on-fedora-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fedora<\/a>, <a href=\"https:\/\/linuxiac.com\/how-to-install-docker-desktop-on-linux-mint-22\/\" target=\"_blank\" rel=\"noreferrer noopener\">Lin<\/a>ux Mint, Pop!_OS, Alma, and Rocky Linux, will walk you through the steps easily.<\/p>\n\n\n\n<p>Next, let\u2019s clarify our setup. On our server, we have two containerized sample applications to which we will proxy the traffic: the FreshRSS reader and the Memos note-taking app, which run on ports 1080 and 5230, respectively.<\/p>\n\n\n\n<p>Of course, you might be working with many more. Nginx Proxy Manager can manage such heavy loads without any issues. We&#8217;ve opted for just two applications to keep things as simple and clear as possible.<\/p>\n\n\n\n<p>Furthermore, we\u2019re using \u201c<em>tmplinux.com<\/em>,\u201d a domain we own and use for tests. We\u2019ll direct two subdomain DNS A records, \u201c<em>rss.tmplinux.com<\/em>\u201d for the FreshRSS app and \u201c<em>memos.tmplinux.com<\/em>\u201d for the Memos note-taking app, to the server public&#8217;s IP address Nginx Proxy Manager runs on.<\/p>\n\n\n\n<p>Here&#8217;s our production process to give you a better visual understanding.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"922\" height=\"346\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm-how-it-wokr.jpg\" alt=\"How Nginx Proxy Manager works\" class=\"wp-image-111293\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm-how-it-wokr.jpg 922w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm-how-it-wokr-380x143.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm-how-it-wokr-768x288.jpg 768w\" sizes=\"(max-width: 922px) 100vw, 922px\" \/><\/figure>\n\n\n\n<p>However, if you don&#8217;t have your&nbsp;own&nbsp;domain, you can always set a static entry for an arbitrary one in your &#8220;<em>\/etc\/hosts<\/em>&#8221; file. <a href=\"https:\/\/linuxiac.com\/how-to-add-static-entries-to-hosts-file-on-linux\/\">Our detailed guide<\/a> explains everything if you need to learn how to do this.<\/p>\n\n\n\n<p>But keep in mind that if you take this approach, you won&#8217;t be able to get a valid SSL certificate from NPM because you need to own a domain name and link it to&nbsp;a real&nbsp;public IP address to do that.<\/p>\n\n\n\n<p>Now that everything is clear, let&#8217;s get straight to the point: setting up Nginx Proxy Manager to handle reverse proxy tasks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-install-nginx-proxy-manager\">Install Nginx Proxy Manager<\/h2>\n\n\n\n<p>Before installing NPM, we must first set up a new Docker network. This network will connect NPM to any other containers it needs to interact with. If we don&#8217;t do this, the&nbsp;Nginx Proxy Manager won&#8217;t be able to interact with these containers and send traffic to them.<\/p>\n\n\n\n<p>Let&#8217;s create our Docker network by choosing &#8220;<em>reverse_proxy<\/em>&#8221; as a name.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">docker network create reverse_proxy<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Next, we\u2019ll verify that everything is in order and the network is available.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">docker network ls<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm03.jpg\"><img decoding=\"async\" width=\"957\" height=\"342\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm03.jpg\" alt=\"Setting up a docker network.\" class=\"wp-image-111359\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm03.jpg 957w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm03-380x136.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm03-768x274.jpg 768w\" sizes=\"(max-width: 957px) 100vw, 957px\" \/><\/a><figcaption class=\"wp-element-caption\">Setting up a docker network.<\/figcaption><\/figure>\n\n\n\n<p>With the &#8220;<em>reverse_proxy<\/em>&#8221; Docker network created, let&#8217;s proceed with the installation of the Nginx Proxy Manager itself. As a first step, create a directory \u201c<em>npm<\/em>\u201d and enter it.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">mkdir npm\n<span class=\"hljs-built_in\">cd<\/span> npm<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>We\u2019ll be deploying NPM using Docker Compose. Open your text editor and create a \u201c<em>docker-compose.yaml<\/em>\u201c file. Paste the content provided below, save it, and exit.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">nano docker-compose.yaml<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"YAML\" data-shcb-language-slug=\"yaml\"><span><code class=\"hljs language-yaml\"><span class=\"hljs-attr\">services:<\/span>\n  <span class=\"hljs-attr\">app:<\/span>\n    <span class=\"hljs-attr\">container_name:<\/span> <span class=\"hljs-string\">npm<\/span>\n    <span class=\"hljs-attr\">image:<\/span> <span class=\"hljs-string\">'jc21\/nginx-proxy-manager:latest'<\/span>\n    <span class=\"hljs-attr\">restart:<\/span> <span class=\"hljs-string\">unless-stopped<\/span>\n    <span class=\"hljs-attr\">ports:<\/span>\n      <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-string\">'80:80'<\/span> <span class=\"hljs-comment\"># Public HTTP Port<\/span>\n      <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-string\">'443:443'<\/span> <span class=\"hljs-comment\"># Public HTTPS Port<\/span>\n      <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-string\">'81:81'<\/span> <span class=\"hljs-comment\"># Admin Web Port<\/span>\n    <span class=\"hljs-attr\">networks:<\/span>\n      <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-string\">reverse_proxy<\/span>\n    <span class=\"hljs-attr\">volumes:<\/span>\n      <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-string\">.\/data:\/data<\/span>\n      <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-string\">.\/letsencrypt:\/etc\/letsencrypt<\/span>\n\n<span class=\"hljs-attr\">networks:<\/span>\n  <span class=\"hljs-attr\">reverse_proxy:<\/span>\n    <span class=\"hljs-attr\">name:<\/span> <span class=\"hljs-string\">reverse_proxy<\/span>\n    <span class=\"hljs-attr\">external:<\/span> <span class=\"hljs-literal\">true<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">YAML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">yaml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>As you can see, this is a pretty simple Compose file. It&#8217;s important to note that ports 80 and 443 are where Nginx Proxy Manager will receive requests, while port 81 lets you access the NPM&#8217;s web admin interface.<\/p>\n\n\n\n<p>Furthermore, we&#8217;re also setting up two volumes in the current directory to keep NPM configuration data and SSL certificates safe.&nbsp;This&nbsp;is crucial because, by design, Docker doesn&#8217;t save data permanently; without these volumes, any data would&nbsp;be lost&nbsp;when the container restarts.<\/p>\n\n\n\n<p>Before we deploy NPM, let&#8217;s ensure that no other services use ports 80 and 443, which&nbsp;are needed&nbsp;for the Nginx Proxy Manager. If these ports are already in use, you&#8217;ll need to stop those services that use them. Otherwise, NPM won&#8217;t start and will show an error.<\/p>\n\n\n\n<p>To see which ports are in use, we&#8217;ll use the <code>netstat<\/code> command and look at its output for ports 80 and 443. We&#8217;re good to go if they aren&#8217;t on the list.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">netstat -tulnp<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm04.jpg\"><img decoding=\"async\" width=\"1024\" height=\"543\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm04-1024x543.jpg\" alt=\"Check the ports in use.\" class=\"wp-image-111380\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm04-1024x543.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm04-380x201.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm04-768x407.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm04.jpg 1232w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Check the ports in use.<\/figcaption><\/figure>\n\n\n\n<p>Now, we\u2019re ready to go ahead and deploy the Nginx Proxy Manager container:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">docker compose up -d<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm05.jpg\"><img decoding=\"async\" width=\"1017\" height=\"289\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm05.jpg\" alt=\"Starting the Nginx Proxy Manager container.\" class=\"wp-image-111398\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm05.jpg 1017w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm05-380x108.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm05-768x218.jpg 768w\" sizes=\"(max-width: 1017px) 100vw, 1017px\" \/><\/a><figcaption class=\"wp-element-caption\">Starting the Nginx Proxy Manager container.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-linking-containers-to-npm-s-docker-network\">Linking Containers to NPM\u2019s Docker Network<\/h2>\n\n\n\n<p>Once again, the&nbsp;Nginx Proxy Manager&nbsp;<strong>must share<\/strong>&nbsp;the same network with the containers to which it proxies requests to be able to communicate with them.&nbsp;This&nbsp;requires modifying their deployments.<\/p>\n\n\n\n<p>For example, the adjustment made to our FreshRSS deployment involves adding a \u201c<em>reverse_proxy<\/em>\u201d network part, as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm06.jpg\"><img decoding=\"async\" width=\"930\" height=\"721\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm06.jpg\" alt=\"Linking containers to Docker's NPM network.\" class=\"wp-image-111410\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm06.jpg 930w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm06-380x295.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm06-768x595.jpg 768w\" sizes=\"(max-width: 930px) 100vw, 930px\" \/><\/a><figcaption class=\"wp-element-caption\">Linking containers to Docker&#8217;s NPM network.<\/figcaption><\/figure>\n\n\n\n<p>Ensure you restart your containers following the changes.<\/p>\n\n\n\n<p>You can also link containers that are already running to the &#8220;<em>reverse_proxy<\/em>&#8221; network we set up earlier by using the following command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">docker network connect reverse_proxy CONTAINER_NAME<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Or when you start them, if you use a single <code>docker run<\/code> command, connect them to the required network:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">docker run --network=reverse_proxy YOUR-OTHER-OPTIONS-HERE<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Use the following command to check if the running containers share the Docker network you need.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">docker ps --format <span class=\"hljs-string\">\"table {{.Names}}\\t{{.Networks}}\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm19.jpg\"><img decoding=\"async\" width=\"964\" height=\"279\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm19.jpg\" alt=\"A list of running Docker containers along with the network they belong to.\" class=\"wp-image-111731\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm19.jpg 964w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm19-380x110.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm19-768x222.jpg 768w\" sizes=\"(max-width: 964px) 100vw, 964px\" \/><\/a><figcaption class=\"wp-element-caption\">A list of running Docker containers along with the network they belong to.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-accessing-the-nginx-proxy-manager-dashboard\">Accessing the Nginx Proxy Manager Dashboard<\/h2>\n\n\n\n<p>Open your browser and go to your server&#8217;s IP address on port 81 (&#8220;<em>http:\/\/server-ip-address:81<\/em>&#8220;), where you can access the NPM admin interface. Log in using the default credentials:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Username: <strong>admin@example.com<\/strong><\/li>\n\n\n\n<li>Password: <strong>changeme<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm07.jpg\"><img decoding=\"async\" width=\"1024\" height=\"680\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm07-1024x680.jpg\" alt=\"Nginx Proxy Manager UI\" class=\"wp-image-111641\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm07-1024x680.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm07-380x252.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm07-768x510.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm07.jpg 1229w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Nginx Proxy Manager UI<\/figcaption><\/figure>\n\n\n\n<p>A popup will appear asking you to update your admin account information. Enter your full name, username, and a valid email address, then click the &#8220;<em>Save<\/em>&#8221; button to confirm your changes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm08.jpg\"><img decoding=\"async\" width=\"1024\" height=\"680\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm08-1024x680.jpg\" alt=\"Update admin account information.\" class=\"wp-image-111647\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm08-1024x680.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm08-380x252.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm08-768x510.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm08.jpg 1231w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Update admin account information.<\/figcaption><\/figure>\n\n\n\n<p>A new window will open for you to update the admin password. Type &#8220;<em>changeme<\/em>&#8221; in the &#8220;<em>Current Password<\/em>&#8221; field and then choose and enter a new secure password in the following two fields. Click &#8220;<em>Save<\/em>&#8221; to apply changes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm09.jpg\"><img decoding=\"async\" width=\"1024\" height=\"680\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm09-1024x680.jpg\" alt=\"Changge NPM admin's password.\" class=\"wp-image-111653\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm09-1024x680.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm09-380x252.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm09-768x510.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm09.jpg 1231w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Changge NPM admin&#8217;s password.<\/figcaption><\/figure>\n\n\n\n<p>This&nbsp;will take you to the user page, where you can see your admin account has&nbsp;been updated.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm10.jpg\"><img decoding=\"async\" width=\"1024\" height=\"591\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm10-1024x591.jpg\" alt=\"Nginx Proxy Manager users.\" class=\"wp-image-111659\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm10-1024x591.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm10-380x219.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm10-768x444.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm10.jpg 1231w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Nginx Proxy Manager users.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-issuance-of-ssl-certificate\">Issuance of SSL Certificate<\/h2>\n\n\n\n<p>We&#8217;re all set to issue a valid SSL certificate so our services can securely connect over HTTPS. Just ensure you have a valid (resolvable) DNS &#8220;A&#8221; record set up that points to the public IP address of the server where you just installed Nginx Proxy Manager.<\/p>\n\n\n\n<p>You can quickly verify this with&nbsp;<a href=\"https:\/\/linuxiac.com\/nslookup-linux-command-explained-with-examples\/\" target=\"_blank\" rel=\"noreferrer noopener\">nslookup<\/a>&nbsp;or the&nbsp;<a href=\"https:\/\/linuxiac.com\/dig-command-in-linux\/https:\/\/linuxiac.com\/dig-command-in-linux\/https:\/\/linuxiac.com\/dig-command-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">dig<\/a>&nbsp;command. For example, we&#8217;re getting an SSL certificate for the host &#8220;<em>memos.tmplinux.com<\/em>.&#8221; A quick check confirms that it points to the correct IP address.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm12.jpg\"><img decoding=\"async\" width=\"899\" height=\"370\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm12.jpg\" alt=\"Checking the DNS record.\" class=\"wp-image-111671\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm12.jpg 899w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm12-380x156.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm12-768x316.jpg 768w\" sizes=\"(max-width: 899px) 100vw, 899px\" \/><\/a><figcaption class=\"wp-element-caption\">Checking the DNS record.<\/figcaption><\/figure>\n\n\n\n<p>Choose &#8220;<em>SSL Certificates<\/em>&#8221; from the main menu. Then, click the &#8220;<em>Add SSL Certificate<\/em>&#8221; button to get your certificate through the Nginx Proxy Manager web interface.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm11.jpg\"><img decoding=\"async\" width=\"1024\" height=\"611\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm11-1024x611.jpg\" alt=\"Issuance of SSL certificate.\" class=\"wp-image-111668\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm11-1024x611.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm11-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm11-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm11.jpg 1189w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Issuance of SSL certificate.<\/figcaption><\/figure>\n\n\n\n<p>From the next screen, do the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In &#8220;<em>Domain Names<\/em>,&#8221; enter the domain name you want to issue a certificate.<\/li>\n\n\n\n<li>Enter a valid email address.<\/li>\n\n\n\n<li>Accept the terms of Let&#8217;s Encrypt.<\/li>\n\n\n\n<li>Click the &#8220;<em>Save<\/em>&#8221; button to begin getting your certificate.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm13.jpg\"><img decoding=\"async\" width=\"1024\" height=\"611\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm13-1024x611.jpg\" alt=\"Issuance of SSL certificate with Nginx Proxy Manager.\" class=\"wp-image-111677\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm13-1024x611.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm13-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm13-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm13.jpg 1188w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Issuance of SSL certificate with Nginx Proxy Manager.<\/figcaption><\/figure>\n\n\n\n<p>NPM will quickly start working behind the scenes, and the entire process of setting up the certificate will take no more than 20-30 seconds.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm14.jpg\"><img decoding=\"async\" width=\"1024\" height=\"611\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm14-1024x611.jpg\" alt=\"Issuance of SSL certificate.\" class=\"wp-image-111686\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm14-1024x611.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm14-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm14-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm14.jpg 1188w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Issuance of SSL certificate.<\/figcaption><\/figure>\n\n\n\n<p>The page will automatically reload, and if everything is successful, your new SSL certificate for the specified domain will appear ready.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm15.jpg\"><img decoding=\"async\" width=\"1024\" height=\"611\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm15-1024x611.jpg\" alt=\"Issuance of SSL certificate.\" class=\"wp-image-111689\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm15-1024x611.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm15-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm15-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm15.jpg 1188w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Issuance of SSL certificate.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-setting-up-reverse-proxy-with-nginx-proxy-manager\">Setting Up Reverse Proxy with Nginx Proxy Manager<\/h2>\n\n\n\n<p>We&#8217;re now at the most exciting part: setting up our reverse proxy using Nginx Proxy Manager. We&#8217;ll explore two scenarios: one where we use an SSL certificate for a secure HTTPS connection and another where we set up a reverse proxy without a certificate, using only HTTP. Let&#8217;s get started.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-npm-reverse-proxy-with-an-ssl-certificate\">NPM Reverse Proxy with an SSL Certificate<\/h3>\n\n\n\n<p>Go to the main menu, choose &#8220;<em>Hosts<\/em>,&#8221; and then select &#8220;<em>Proxy Hosts<\/em>&#8221; from the submenu that appears.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm16.jpg\"><img decoding=\"async\" width=\"1024\" height=\"611\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm16-1024x611.jpg\" alt=\"Adding a host.\" class=\"wp-image-111704\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm16-1024x611.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm16-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm16-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm16.jpg 1188w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Adding a host.<\/figcaption><\/figure>\n\n\n\n<p>On the next page, click the &#8220;<em>Add Proxy Host<\/em>&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm17.jpg\"><img decoding=\"async\" width=\"1024\" height=\"611\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm17-1024x611.jpg\" alt=\"Adding a host.\" class=\"wp-image-111707\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm17-1024x611.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm17-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm17-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm17.jpg 1188w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Adding a host.<\/figcaption><\/figure>\n\n\n\n<p>This section is crucial for setting up a successful reverse proxy connection, so we&#8217;ve detailed each option below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm18.jpg\"><img decoding=\"async\" width=\"1024\" height=\"612\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm18-1024x612.jpg\" alt=\"Adding a proxy host to Nginx Proxy Manager.\" class=\"wp-image-111710\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm18-1024x612.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm18-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm18-768x459.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm18.jpg 1184w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Adding a proxy host to Nginx Proxy Manager.<\/figcaption><\/figure>\n\n\n\n<p>From the &#8220;<em>Details<\/em>&#8221; tab, in the &#8220;<em>Domain Names<\/em>&#8221; field, enter the domain name for which you want Nginx Proxy Manager to create a reverse proxy. In our case, this is the name for which we just issued an SSL certificate in the previous step, namely &#8220;<em>memos.tmplinux.com<\/em>.&#8221;<\/p>\n\n\n\n<p>The &#8220;<em>Scheme<\/em>&#8221; section is crucial. You can choose between &#8220;<em>http<\/em>&#8221; and &#8220;<em>https<\/em>&#8221; here. This choice indicates whether the Docker container listens for HTTP or HTTPS requests. In almost all cases, Docker containers&nbsp;aren&#8217;t set up&nbsp;out-of-the-box to handle HTTPS by default, so you&#8217;ll typically want to go with &#8220;<em>http<\/em>&#8221; here.<\/p>\n\n\n\n<p>In the &#8220;<em>Forward Hostname\/IP<\/em>&#8221; box, just type in the name of the Docker service. Because we send traffic to&nbsp;both&nbsp;the NPM container and the other Docker containers to share the same Docker network, the Nginx Proxy Manager connects to them using their service names.<\/p>\n\n\n\n<p>Not sure what the name of the service is? Take a look at the image below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm20.jpg\"><img decoding=\"async\" width=\"964\" height=\"303\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm20.jpg\" alt=\"Docker service name.\" class=\"wp-image-111743\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm20.jpg 964w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm20-380x119.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm20-768x241.jpg 768w\" sizes=\"(max-width: 964px) 100vw, 964px\" \/><\/a><figcaption class=\"wp-element-caption\">Docker service name.<\/figcaption><\/figure>\n\n\n\n<p>In the &#8220;<em>Forward Port<\/em>&#8221; field, type in the Docker container&#8217;s port number to receive incoming requests. Again, this is&nbsp;not to be confused with ports 80 and 443, on which the NPM container itself listens.<\/p>\n\n\n\n<p>If you&#8217;re unsure about the ports, you can easily check them using the following command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">docker ps --format <span class=\"hljs-string\">\"table {{.Names}}\\t{{.Ports}}\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm21.jpg\"><img decoding=\"async\" width=\"978\" height=\"290\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm21.jpg\" alt=\"Check which ports are being used by running Docker containers.\" class=\"wp-image-111752\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm21.jpg 978w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm21-380x113.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm21-768x228.jpg 768w\" sizes=\"(max-width: 978px) 100vw, 978px\" \/><\/a><figcaption class=\"wp-element-caption\">Check which ports are being used by running Docker containers.<\/figcaption><\/figure>\n\n\n\n<p>Just to <span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">clarify things, when you see &#8220;<em>1080->80<\/em>,&#8221;<\/span> for example, it means that the Docker container is linking its own internal port 80 to port 1080 on the host computer. In other words, the Docker container port itself on which it listens is 80, not 1080.<\/p>\n\n\n\n<p>Finally, we recommend turning on the &#8220;<em>Block Common Exploits<\/em>&#8221; option for better protection against&nbsp;common&nbsp;cyber attacks.<\/p>\n\n\n\n<p>Don&#8217;t rush to click the &#8220;<em>Save<\/em>&#8221; button; instead, switch to the &#8220;<em>SSL<\/em>&#8221; tab. From the &#8220;<em>SSL Certificate<\/em>&#8221; menu, select the Let&#8217;s Encrypt certificate you issued a little while ago.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm26.jpg\"><img decoding=\"async\" width=\"1024\" height=\"610\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm26-1024x610.jpg\" alt=\"Set SSL certificate in Nginx Proxy Manager.\" class=\"wp-image-111785\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm26-1024x610.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm26-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm26-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm26.jpg 1186w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Set SSL certificate in Nginx Proxy Manager.<\/figcaption><\/figure>\n\n\n\n<p>Enable these settings:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&#8220;<em>Force SSL<\/em>&#8220;: This automatically redirects traffic from HTTP to HTTPS for secure browsing.<\/li>\n\n\n\n<li>&#8220;<em>HTTP\/2 Support<\/em>&#8220;: The recommended HTTP protocol version used today.<\/li>\n\n\n\n<li>&#8220;<em>HSTS Enabled<\/em>&#8220;: This helps protect against certain malicious attacks.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm23.jpg\"><img decoding=\"async\" width=\"1024\" height=\"610\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm23-1024x610.jpg\" alt=\"Set SSL certificate in Nginx Proxy Manager.\" class=\"wp-image-111764\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm23-1024x610.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm23-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm23-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm23.jpg 1186w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Set SSL certificate in Nginx Proxy Manager.<\/figcaption><\/figure>\n\n\n\n<p>Finally, click &#8220;<em>Save<\/em>&#8221; to apply your changes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm24.jpg\"><img decoding=\"async\" width=\"1024\" height=\"610\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm24-1024x610.jpg\" alt=\"Configuring a reverse proxy in NPM.\" class=\"wp-image-111767\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm24-1024x610.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm24-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm24-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm24.jpg 1186w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Configuring a reverse proxy in NPM.<\/figcaption><\/figure>\n\n\n\n<p>The moment of truth! Point your browser to the address you set up in NPM. Your application should be running securely over HTTPS, as\u00a0indicated by the padlock icon in the address bar. What can I add other than &#8211; congratulations!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm25.jpg\"><img decoding=\"async\" width=\"1024\" height=\"610\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm25-1024x610.jpg\" alt=\"NPM reverse proxy successfully configured.\" class=\"wp-image-111770\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm25-1024x610.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm25-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm25-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm25.jpg 1186w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">NPM reverse proxy successfully configured.<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-npm-reverse-proxy-without-ssl\">NPM Reverse Proxy without SSL<\/h3>\n\n\n\n<p>Adding a reverse proxy in NPM to a host that doesn&#8217;t use an SSL certificate is similar to the previous example, but everything you need to do is in the &#8220;<em>Details<\/em>&#8221; tab. In other words, you don&#8217;t need to touch the &#8220;<em>SSL<\/em>&#8221; tab.<\/p>\n\n\n\n<p>We&#8217;ll add an entry for &#8220;<em>rss.tmplinux.com<\/em>,&#8221; pointing to our second Docker container. To do this how you&#8217;re used to, go to the main menu and choose &#8220;<em>Hosts<\/em>&#8221; then &#8220;<em>Proxy Hosts<\/em>&nbsp;&#8220;.&nbsp;After that,&nbsp;just&nbsp;click on the &#8220;<em>Add Proxy Host<\/em>&#8221; button.<\/p>\n\n\n\n<p>The scheme is &#8220;<em>http<\/em>,&#8221; and the Docker service is named &#8220;<em>freshrss<\/em>.&#8221; The container uses port 80. Fill in the necessary information for your case, and apply the settings you made, confirming with the &#8220;<em>Save<\/em>&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm27.jpg\"><img decoding=\"async\" width=\"1024\" height=\"614\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm27-1024x614.jpg\" alt=\"Adding a proxy host to Nginx Proxy Manager.\" class=\"wp-image-111911\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm27-1024x614.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm27-380x228.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm27-768x460.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm27.jpg 1185w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Adding a proxy host to Nginx Proxy Manager.<\/figcaption><\/figure>\n\n\n\n<p>Note that unlike our first host, &#8220;<em>memos.tmplinux.com<\/em>,&#8221; for which we issued and configured the use of an SSL certificate, our new address is marked as &#8220;<em>HTTP only<\/em>.&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm28.jpg\"><img decoding=\"async\" width=\"1024\" height=\"611\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm28-1024x611.jpg\" alt=\"Configuring a reverse proxy (without using SSL) in NPM.\" class=\"wp-image-111914\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm28-1024x611.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm28-380x227.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm28-768x458.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm28.jpg 1185w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Configuring a reverse proxy (without using SSL) in NPM.<\/figcaption><\/figure>\n\n\n\n<p>By pointing our browser to the address, NPM proxies traffic to it over an unsecured HTTP connection only.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm29.jpg\"><img decoding=\"async\" width=\"1024\" height=\"659\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm29-1024x659.jpg\" alt=\"NPM reverse proxy successfully configured.\" class=\"wp-image-111917\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm29-1024x659.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm29-380x245.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm29-768x495.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm29.jpg 1185w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">NPM reverse proxy successfully configured.<\/figcaption><\/figure>\n\n\n\n<p>It is important to note that we recommend only going with this option if, for example, you&#8217;ll be using the service solely within your home network. However, if your service is accessible over the internet, set up an SSL certificate in Nginx Proxy Manager to enable secure HTTPS connections.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-restricting-access-by-ip-address-in-nginx-proxy-manager\">Restricting Access by IP Address in Nginx Proxy Manager<\/h2>\n\n\n\n<p>One effective way to improve security is restricting access based on IP addresses. Nginx Proxy Manager makes this process incredibly quick and simple, requiring just a few clicks. Let&#8217;s walk you through it.<\/p>\n\n\n\n<p>Navigate to the &#8220;<em>Access Lists<\/em>&#8221; section and click the &#8220;<em>Add Access List<\/em>&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm30.jpg\"><img decoding=\"async\" width=\"1024\" height=\"659\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm30-1024x659.jpg\" alt=\"Restricting access by IP address in Nginx Proxy Manager.\" class=\"wp-image-111932\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm30-1024x659.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm30-380x245.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm30-768x495.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm30.jpg 1185w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Restricting access by IP address in Nginx Proxy Manager.<\/figcaption><\/figure>\n\n\n\n<p>A modal window will appear. In the &#8220;<em>Details<\/em>&#8221; section, specify some descriptive name of your choice.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm31.jpg\"><img decoding=\"async\" width=\"1024\" height=\"659\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm31-1024x659.jpg\" alt=\"Creating a new access list in NPM.\" class=\"wp-image-111935\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm31-1024x659.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm31-380x245.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm31-768x495.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm31.jpg 1185w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Creating a new access list in NPM.<\/figcaption><\/figure>\n\n\n\n<p>Switch to the &#8220;<em>Access<\/em>&#8221; tab. Suppose you want to restrict access to your private home network IP range, &#8220;<em>192.168.x.x<\/em>,&#8221; and a specific public IP address,&nbsp;&#8220;<em>1.2.3.4<\/em>&#8220;.<\/p>\n\n\n\n<p>Input the appropriate addresses for your situation, ensuring the final entry is a &#8220;<em>deny<\/em>&#8221; directive set to &#8220;<em>all<\/em>.&#8221; Once you have finished configuring the settings, click the &#8220;<em>Save<\/em>&#8221; button to apply the changes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm32.jpg\"><img decoding=\"async\" width=\"1024\" height=\"659\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm32-1024x659.jpg\" alt=\"Creating a new access list in NPM.\" class=\"wp-image-111938\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm32-1024x659.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm32-380x245.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm32-768x495.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm32.jpg 1185w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Creating a new access list in NPM.<\/figcaption><\/figure>\n\n\n\n<p>If this is your first time creating an access list, it will appear at the top of the list. If you need to make changes, don&#8217;t worry\u2014you can easily edit it anytime by clicking the three-dot icon on the right and selecting &#8220;<em>Edit<\/em>.&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm33.jpg\"><img decoding=\"async\" width=\"1024\" height=\"550\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm33-1024x550.jpg\" alt=\"Access lists.\" class=\"wp-image-111941\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm33-1024x550.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm33-380x204.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm33-768x413.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm33.jpg 1185w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Access lists.<\/figcaption><\/figure>\n\n\n\n<p>Now, let&#8217;s apply the access list to one of our hosts, &#8220;<em>memos.tmplinux.com<\/em>.&#8221; Navigate to &#8220;<em>Hosts<\/em>&#8221; -&gt; &#8220;<em>Proxy Hosts<\/em>,&#8221; then click on the three-dot icon on the right and select &#8220;<em>Edit<\/em>.&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm34.jpg\"><img decoding=\"async\" width=\"1024\" height=\"626\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm34-1024x626.jpg\" alt=\"Applying an NPM access list to the host.\" class=\"wp-image-111953\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm34-1024x626.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm34-380x232.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm34-768x470.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm34.jpg 1185w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Applying&nbsp;an NPM access list to the host.<\/figcaption><\/figure>\n\n\n\n<p>From the &#8220;<em>Access List<\/em>&#8221; drop-down menu, choose the recently created &#8220;<em>My Access List<\/em>&#8221; and click &#8220;<em>Save<\/em>&#8221; to confirm.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm35.jpg\"><img decoding=\"async\" width=\"1024\" height=\"626\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm35-1024x626.jpg\" alt=\"Applying an NPM access list to the host.\" class=\"wp-image-111956\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm35-1024x626.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm35-380x232.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm35-768x470.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm35.jpg 1185w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Applying&nbsp;an NPM access list to the host.<\/figcaption><\/figure>\n\n\n\n<p>And that&#8217;s it. Now, if we try to access the service from an IP address other than the ones allowed in our &#8220;<em>My Access List<\/em>,&#8221; Nginx Proxy Manager will show the &#8220;<em>403 Forbidden<\/em>&#8221; page shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm36.jpg\"><img decoding=\"async\" width=\"1024\" height=\"626\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm36-1024x626.jpg\" alt=\"Deny access with NPM.\" class=\"wp-image-111959\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm36-1024x626.jpg 1024w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm36-380x232.jpg 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm36-768x470.jpg 768w, https:\/\/linuxiac.com\/wp-content\/uploads\/2024\/04\/npm36.jpg 1185w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Deny access with NPM.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>Setting up a reverse proxy using Nginx Proxy Manager offers a robust and user-friendly solution for managing server traffic, improving security, and optimizing performance.<\/p>\n\n\n\n<p>By providing a convenient UI, NPM makes it accessible for users, even with limited command-line experience, to configure a reliable, performant, and secure reverse proxy server.<\/p>\n\n\n\n<p>It also efficiently simplifies the integration of SSL certificates and access controls, eliminating much of the complexity traditionally associated with setting up such a server.<\/p>\n\n\n\n<p>For more information, we highly recommend visiting the official <a href=\"https:\/\/nginxproxymanager.com\/guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">NPM documentation<\/a> or the <a href=\"https:\/\/nginxproxymanager.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">project&#8217;s website<\/a>.<\/p>\n\n\n\n<p>Thanks for your time! I hope you find this guide helpful. Please let me know in the comments section below if you have any questions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn to set up a reverse proxy with Nginx Proxy Manager, enhancing server management and security in just a few easy steps.<\/p>\n","protected":false},"author":10,"featured_media":111263,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,4417],"tags":[5816,4279],"class_list":["post-111260","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-linux-knowledge","tag-nginx-proxy-manager","tag-reverse-proxy"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts\/111260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/comments?post=111260"}],"version-history":[{"count":0,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts\/111260\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/media\/111263"}],"wp:attachment":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/media?parent=111260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/categories?post=111260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/tags?post=111260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}