<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Http-Host-Header on K-Life Hack | Systems Architecture &amp; DevOps</title><link>https://klifehack.com/en/tags/http-host-header/</link><description>Recent content in Http-Host-Header on K-Life Hack | Systems Architecture &amp; DevOps</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Thu, 27 Aug 2026 10:10:07 +0900</lastBuildDate><atom:link href="https://klifehack.com/en/tags/http-host-header/index.xml" rel="self" type="application/rss+xml"/><item><title>Configuration Verification of Host Header Forwarding and Context Preservation Under Nginx Reverse Proxy</title><link>https://klifehack.com/en/p/nginx-proxy-pass-host-header-preservation/</link><pubDate>Thu, 27 Aug 2026 10:10:07 +0900</pubDate><guid>https://klifehack.com/en/p/nginx-proxy-pass-host-header-preservation/</guid><description>&lt;h2 id="1-architectural-background-and-problem-statement"&gt;1. Architectural Background and Problem Statement&#10;&lt;/h2&gt;&lt;p&gt;In a multi-tier web application architecture, Nginx is deployed as an edge reverse proxy and Web Server (WS), serving to relay traffic to downstream Web Application Servers (WAS: Spring Boot, Tomcat, etc.).&lt;/p&gt;&#10;&lt;p&gt;Requests from external clients for the domain &lt;b&gt;abc.co.kr&lt;/b&gt; are forwarded via Nginx to the WAS on the internal network (e.g., &lt;b&gt;localhost:8080&lt;/b&gt;) using the &lt;b&gt;proxy_pass&lt;/b&gt; directive.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;[ Client Request: http://abc.co.kr ]&#10; │&#10; ▼&#10; [ Nginx Reverse Proxy ]&#10; (Listens on Port 80 / Domain: abc.co.kr)&#10; │ proxy_pass http://localhost:8080&#10; ▼&#10; [ Downstream WAS ]&#10; (e.g., Spring Boot / Tomcat on :8080)&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this configuration, when using &lt;b&gt;proxy_pass&lt;/b&gt; with default settings, referencing &lt;b&gt;request.getRequestURL()&lt;/b&gt; or the &lt;b&gt;HttpServletRequest&lt;/b&gt; context in the WAS layer identifies the request not by the original domain accessed by the client (&lt;b&gt;abc.co.kr&lt;/b&gt;), but as the internal loopback address (&lt;b&gt;localhost:8080&lt;/b&gt; or &lt;b&gt;127.0.0.1&lt;/b&gt;).&lt;/p&gt;&#10;&lt;p&gt;This document analyzes the header reconstruction mechanism in the Nginx HTTP proxy module (&lt;b&gt;ngx_http_proxy_module&lt;/b&gt;) and details the configuration and verification procedures required to fully preserve and transmit the original request context.&lt;/p&gt;&#10;&lt;h2 id="2-root-cause-analysis"&gt;2. Root Cause Analysis&#10;&lt;/h2&gt;&lt;p&gt;When forwarding requests to backend servers, Nginx&amp;rsquo;s &lt;b&gt;ngx_http_proxy_module&lt;/b&gt; reconstructs HTTP request headers by default.&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;b&gt;Host Header Rewriting&lt;/b&gt;: Nginx automatically sets the target hostname specified in &lt;b&gt;proxy_pass&lt;/b&gt; (e.g., &lt;b&gt;localhost:8080&lt;/b&gt;) as the value of the &lt;b&gt;Host&lt;/b&gt; header sent upstream.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;b&gt;Loss of Client Metadata&lt;/b&gt;: Unless explicitly configured via &lt;b&gt;proxy_set_header&lt;/b&gt;, information regarding the source client&amp;rsquo;s IP address (&lt;b&gt;X-Real-IP&lt;/b&gt;), the proxy transit chain (&lt;b&gt;X-Forwarded-For&lt;/b&gt;), and the communication protocol (&lt;b&gt;X-Forwarded-Proto&lt;/b&gt;) is either discarded or not aggregated.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;As a result, the WAS processes the incoming connection as a request originating directly from the local environment rather than through a proxy, causing inconsistencies in absolute URL generation and redirect handling during SSL offloading.&lt;/p&gt;&#10;&lt;h2 id="3-configuration-modification-procedure"&gt;3. Configuration Modification Procedure&#10;&lt;/h2&gt;&lt;p&gt;Modify the location block within the virtual host configuration file (&lt;b&gt;/etc/nginx/nginx.conf&lt;/b&gt; or &lt;b&gt;/etc/nginx/conf.d/*.conf&lt;/b&gt;).&lt;/p&gt;&#10;&lt;h3 id="31-default-configuration-as-is"&gt;3.1 Default Configuration (AS-IS)&#10;&lt;/h3&gt;&lt;p&gt;In the absence of header forwarding directives, the WAS receives &lt;b&gt;Host: localhost:8080&lt;/b&gt;.&lt;/p&gt;&#10;&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;server&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;listen&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;80&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;server_name&lt;/span&gt; &lt;span style="color:#e6db74"&gt;abc.co.kr&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;location&lt;/span&gt; &lt;span style="color:#e6db74"&gt;/&lt;/span&gt; {&#10;&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://localhost:8080&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="32-modified-configuration-to-be"&gt;3.2 Modified Configuration (TO-BE)&#10;&lt;/h3&gt;&lt;p&gt;Explicitly map client context variables to proxy request headers.&lt;/p&gt;&#10;&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;server&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;listen&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;80&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;server_name&lt;/span&gt; &lt;span style="color:#e6db74"&gt;abc.co.kr&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;location&lt;/span&gt; &lt;span style="color:#e6db74"&gt;/&lt;/span&gt; {&#10;&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://localhost:8080&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Preserve the original Host header&#10;&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;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Forward the client&amp;#39;s actual IP address&#10;&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;X-Real-IP&lt;/span&gt; $remote_addr;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Maintain the list of IP addresses traversed through the proxy chain&#10;&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;X-Forwarded-For&lt;/span&gt; $proxy_add_x_forwarded_for;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Forward the original request protocol (http or https)&#10;&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;X-Forwarded-Proto&lt;/span&gt; $scheme;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="4-directive-functional-specifications"&gt;4. Directive Functional Specifications&#10;&lt;/h2&gt;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: left"&gt;Directive&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: left"&gt;Variable Used&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: left"&gt;Technical Role and Functional Overview&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;code&gt;proxy_set_header Host&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;code&gt;$host&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;Preserves the original host name requested by the client. &lt;code&gt;$host&lt;/code&gt; contains the host name from the request line or the host name from the &lt;code&gt;Host&lt;/code&gt; header field.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;code&gt;proxy_set_header X-Real-IP&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;code&gt;$remote_addr&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;Passes the physical IP address of the client directly connected to Nginx.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;code&gt;proxy_set_header X-Forwarded-For&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;code&gt;$proxy_add_x_forwarded_for&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;Appends the client&amp;rsquo;s &lt;code&gt;$remote_addr&lt;/code&gt; to the end of the existing &lt;code&gt;X-Forwarded-For&lt;/code&gt; header value, ensuring traceability across multi-tier proxy environments.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;code&gt;proxy_set_header X-Forwarded-Proto&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;code&gt;$scheme&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;Passes the transmission protocol (&lt;code&gt;http&lt;/code&gt; or &lt;code&gt;https&lt;/code&gt;) used between the client and Nginx. Essential for preventing redirect loops and issuing Secure cookies on the WAS side.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;h2 id="5-equivalent-configuration-in-apache-http-server"&gt;5. Equivalent Configuration in Apache HTTP Server&#10;&lt;/h2&gt;&lt;p&gt;This behavior is not limited to Nginx; it also occurs when operating Apache HTTP Server (&lt;b&gt;httpd&lt;/b&gt;) as a reverse proxy via &lt;b&gt;mod_proxy&lt;/b&gt;.&lt;/p&gt;&#10;&lt;p&gt;Because Apache rewrites the &lt;b&gt;Host&lt;/b&gt; header to the backend address by default, the &lt;b&gt;ProxyPreserveHost On&lt;/b&gt; directive must be explicitly defined within the virtual host as follows:&lt;/p&gt;&#10;&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-apache" data-lang="apache"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;&amp;lt;virtualhost&lt;/span&gt; &lt;span style="color:#e6db74"&gt;*:80=&amp;#34;&amp;#34;&lt;/span&gt;&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ServerName abc.co.kr&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ProxyPreserveHost &lt;span style="color:#66d9ef"&gt;On&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ProxyPass / http://localhost:8080/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ProxyPassReverse / http://localhost:8080/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;&amp;lt;/virtualhost&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="6-troubleshooting-and-operational-verification"&gt;6. Troubleshooting and Operational Verification&#10;&lt;/h2&gt;&lt;p&gt;Typical troubleshooting procedures and verification log examples when applying the configuration are shown below.&lt;/p&gt;&#10;&lt;h3 id="-friction-points"&gt;⚠️ Friction Points&#10;&lt;/h3&gt;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;b&gt;Infinite Redirect Loops&lt;/b&gt;: During SSL offloading (receiving HTTPS at Nginx and forwarding as HTTP to WAS), if &lt;b&gt;X-Forwarded-Proto&lt;/b&gt; is missing, the WAS continuously responds with redirects to HTTPS (301/302), resulting in a redirect loop.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;b&gt;IP Spoofing in Multi-Proxy Environments&lt;/b&gt;: When an upstream load balancer exists, referencing only &lt;b&gt;$remote_addr&lt;/b&gt; records the private IP of the load balancer; therefore, an appropriate combination of &lt;b&gt;set_real_ip_from&lt;/b&gt; and &lt;b&gt;real_ip_header&lt;/b&gt; must be considered.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="-operational-verification-logs"&gt;🛠️ Operational Verification Logs&#10;&lt;/h3&gt;&lt;p&gt;Execution log for Nginx configuration syntax check and request header transparency verification commands:&lt;/p&gt;&#10;&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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# nginx -t&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nginx: the configuration file /etc/nginx/nginx.conf syntax is ok&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nginx: configuration file /etc/nginx/nginx.conf test is successful&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# systemctl reload nginx&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# curl -Iv -H &amp;#34;Host: abc.co.kr&amp;#34; http://127.0.0.1/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Trying 127.0.0.1:80...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;gt; GET / HTTP/1.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;gt; Host: abc.co.kr&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;gt; User-Agent: curl/7.81.0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;gt; Accept: */*&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;lt; HTTP/1.1 200 OK&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;lt; Server: nginx/1.24.0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;lt; Date: Thu, 27 Aug 2026 09:15:00 GMT&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;lt; Content-Type: text/html;charset=UTF-8&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;lt; Connection: keep-alive&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;amp;lt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Header recognition confirmation in the WAS-side logs:&lt;/p&gt;&#10;&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-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;2026-08-27 09:15:00.102 [http-nio-8080-exec-1] DEBUG o.s.web.servlet.DispatcherServlet - GET &amp;#34;/&amp;#34;, parameters={}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[Header Trace]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Host: abc.co.kr&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;X-Real-IP: 203.0.113.195&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;X-Forwarded-For: 203.0.113.195&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;X-Forwarded-Proto: http&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Request URL Resolved: http://abc.co.kr/&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="7-lessons-learned"&gt;7. Lessons Learned&#10;&lt;/h2&gt;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;When using &lt;b&gt;proxy_pass&lt;/b&gt;, it is an operational best practice not merely to forward the path, but to explicitly set the context headers (&lt;b&gt;Host&lt;/b&gt;, &lt;b&gt;X-Real-IP&lt;/b&gt;, &lt;b&gt;X-Forwarded-For&lt;/b&gt;, &lt;b&gt;X-Forwarded-Proto&lt;/b&gt;) required by the upstream.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;On the backend framework side (such as Spring Boot), configurations to trust proxy headers—such as properly enabling &lt;b&gt;ForwardedHeaderFilter&lt;/b&gt; or &lt;b&gt;server.forward-headers-strategy&lt;/b&gt;—must be operated in tandem with the reverse proxy configuration.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;</description></item></channel></rss>