<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nginx-Proxy-Manager on K-Life Hack | Systems Architecture &amp; DevOps</title><link>https://klifehack.com/en/tags/nginx-proxy-manager/</link><description>Recent content in Nginx-Proxy-Manager on K-Life Hack | Systems Architecture &amp; DevOps</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Thu, 28 May 2026 17:04:17 +0900</lastBuildDate><atom:link href="https://klifehack.com/en/tags/nginx-proxy-manager/index.xml" rel="self" type="application/rss+xml"/><item><title>Implementation Methods for NGINX Reverse Proxy: Nginx Proxy Manager and Manual Configuration</title><link>https://klifehack.com/en/p/nginx-reverse-proxy-implementation-guide/</link><pubDate>Thu, 28 May 2026 17:04:17 +0900</pubDate><guid>https://klifehack.com/en/p/nginx-reverse-proxy-implementation-guide/</guid><description>&lt;p&gt;This document details the procedures for constructing an NGINX reverse proxy environment to route external traffic from a public IP address to a backend application (Apache Tomcat) on a private network. Two implementation approaches are explained: the introduction of &lt;b&gt;Nginx Proxy Manager (NPM)&lt;/b&gt;, a Docker-based GUI management tool, and &lt;b&gt;manual configuration&lt;/b&gt; via the command line.&lt;/p&gt;
&lt;h2 id="1-implementation-via-nginx-proxy-manager-npm"&gt;1. Implementation via Nginx Proxy Manager (NPM)
&lt;/h2&gt;&lt;p&gt;Nginx Proxy Manager is a solution that allows centralized management of reverse proxies, SSL certificate management, and access list control from a web interface.&lt;/p&gt;
&lt;h3 id="11-avoiding-conflicts-with-existing-services"&gt;1.1 Avoiding Conflicts with Existing Services
&lt;/h3&gt;&lt;p&gt;Since NPM occupies ports 80 and 443, if an NGINX service is running natively on the host OS, it must be stopped and disabled.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Stop service&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;systemctl stop nginx
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Disable auto-start&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;systemctl disable nginx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="12-preparing-the-docker-environment"&gt;1.2 Preparing the Docker Environment
&lt;/h3&gt;&lt;p&gt;As NPM runs as a container, the installation of Docker Engine and Docker Compose is mandatory.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Repository Configuration&lt;/b&gt;: Install &lt;code&gt;yum-utils&lt;/code&gt; and add the official Docker repository.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dnf install -y yum-utils
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="2"&gt;
&lt;li&gt;&lt;b&gt;Enabling the Service&lt;/b&gt;: Start the Docker daemon and configure it to run automatically on system reboot.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;systemctl start docker
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;systemctl enable docker
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="13-container-orchestration"&gt;1.3 Container Orchestration
&lt;/h3&gt;&lt;p&gt;Create a dedicated directory to manage NPM configuration files and define &lt;code&gt;docker-compose.yml&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir ~/npm
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd ~/npm
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vi docker-compose.yml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In &lt;code&gt;docker-compose.yml&lt;/code&gt;, specify the official image, database parameters, and volume mappings for persistence. After the definition is complete, start the container in the background using the following command.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker compose up -d
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="14-proxy-configuration-via-web-ui"&gt;1.4 Proxy Configuration via Web UI
&lt;/h3&gt;&lt;p&gt;After the container starts, access the management dashboard (default port: 81) to perform settings.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Initial Authentication&lt;/b&gt;: Access &lt;code&gt;http://[Public_IP]:81&lt;/code&gt; and log in with the initial credentials (&lt;code&gt;admin@example.com&lt;/code&gt; / &lt;code&gt;changeme&lt;/code&gt;). A password change is required upon the first login.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Adding a Proxy Host&lt;/b&gt;: Select &amp;ldquo;Add Proxy Host&amp;rdquo; and enter the following parameters.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Domain Names&lt;/b&gt;: The domain or IP address to be published&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Scheme&lt;/b&gt;: http&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Forward Hostname / IP&lt;/b&gt;: 10.101.0.28 (Private IP of the backend Tomcat)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Forward Port&lt;/b&gt;: 8080&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="3"&gt;
&lt;li&gt;&lt;b&gt;Connectivity Verification&lt;/b&gt;: Access the public IP from a browser and confirm that the response from Tomcat is returned.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="2-implementation-via-manual-nginx-configuration"&gt;2. Implementation via Manual NGINX Configuration
&lt;/h2&gt;&lt;p&gt;In environments where a GUI is not required or where a more lightweight configuration is desired, perform pass-through settings by directly operating the NGINX package.&lt;/p&gt;
&lt;h3 id="21-nginx-installation-and-initialization"&gt;2.1 NGINX Installation and Initialization
&lt;/h3&gt;&lt;p&gt;Install NGINX using the DNF package manager. After installation, execute &lt;code&gt;curl -I http://localhost&lt;/code&gt; to verify that the web server responds normally.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dnf install nginx -y
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;systemctl start nginx
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;systemctl enable nginx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="22-network-security-settings"&gt;2.2 Network Security Settings
&lt;/h3&gt;&lt;p&gt;To allow external traffic, open port 80 in the OS firewall (iptables).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;iptables -I INPUT &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; -p tcp --dport &lt;span style="color:#ae81ff"&gt;80&lt;/span&gt; -j ACCEPT
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="23-configuring-the-proxy_pass-directive"&gt;2.3 Configuring the proxy_pass Directive
&lt;/h3&gt;&lt;p&gt;Define the core logic of the reverse proxy in &lt;code&gt;nginx.conf&lt;/code&gt;. Open &lt;code&gt;/etc/nginx/nginx.conf&lt;/code&gt; and modify the &lt;code&gt;location /&lt;/code&gt; block within the &lt;code&gt;server&lt;/code&gt; context.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-nginx" data-lang="nginx"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;location&lt;/span&gt; &lt;span style="color:#e6db74"&gt;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Forward traffic to backend Tomcat server (port 8080)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;proxy_pass&lt;/span&gt; &lt;span style="color:#e6db74"&gt;http://127.0.0.1:8080&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Add header information as needed (optional)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;proxy_set_header&lt;/span&gt; &lt;span style="color:#e6db74"&gt;Host&lt;/span&gt; $host;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;proxy_set_header&lt;/span&gt; &lt;span style="color:#e6db74"&gt;X-Real-IP&lt;/span&gt; $remote_addr;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;proxy_set_header&lt;/span&gt; &lt;span style="color:#e6db74"&gt;X-Forwarded-For&lt;/span&gt; $proxy_add_x_forwarded_for;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="24-validation-and-application-of-settings"&gt;2.4 Validation and Application of Settings
&lt;/h3&gt;&lt;p&gt;Perform a syntax check on the configuration file, and after confirming there are no errors, reload the service. By using &lt;code&gt;reload&lt;/code&gt;, settings can be applied while maintaining existing connections.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Syntax check&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nginx -t
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Reload configuration&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;systemctl reload nginx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="3-operational-considerations"&gt;3. Operational Considerations
&lt;/h2&gt;&lt;p&gt;&lt;b&gt;Port Conflict Management&lt;/b&gt;: When running multiple web services on the same host, it is necessary to clarify which process is assigned the binding rights for ports 80/443.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Security&lt;/b&gt;: When using NPM, it is recommended to restrict access to the management port (81) at the network layer so that it is only allowed from specific IP addresses.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Persistence&lt;/b&gt;: When configuring Docker, ensure that volume mappings are correctly set to guarantee that configuration data is not lost if the container is destroyed.&lt;/p&gt;
&lt;h2 id="summary"&gt;Summary
&lt;/h2&gt;&lt;p&gt;This document presented two methods for constructing a reverse proxy using NGINX. Nginx Proxy Manager enables intuitive operation, while manual configuration provides system transparency and customizability. Select the appropriate method based on requirements to achieve secure and efficient traffic routing to the backend server.&lt;/p&gt;</description></item></channel></rss>