Skip to main content
ldsouza
Staff
Staff
June 30, 2026

Troubleshooting Tip: How to Forward the Client's Original IP Address and Port Information

  • June 30, 2026
  • 0 replies
  • 28 views

Description

This article describes how to insert the client IP and source port in the HTTP header.

Scope

FortiWeb.

Solution

  1. Configure the URL Rewriting Rule under Application Delivery -> URL Rewriting -> URL Rewriting Rule.

    Define the HTTP URL under the URL Rewriting Condition Table, and define the headers CLIENT_IP, CLIENT_PORT, and the corresponding variables $CLIENT_IP and $CLIENT_PORT under HTTP Header Insertion, enabling the Header field toggle with Replace the Existing Headers.

85a0ddaa.png


  1. Configure the URL Rewriting Policy by adding the configured URL Rewriting Rule.


be5a8667.png


  1. Add the URL Rewriting Policy in the Web protection profile and refer to it in the Server Policy.


32eafd1b.png


  1. Initiate the traffic as seen in the client packet capture: the Source port is 58602, and the Source IP is 172.26.48.14.


83903273.png


  1. The backend capture shows that FortiWeb has added the CLIENT_IP and CLIENT_PORT headers with the values.


bc934663.png


Related document:
FortiWeb admin guide: Rewriting & redirecting.