How to send the client IP address through a dedicated HTTP header

When a user makes a request to an application, the X-Forwarded-For HTTP header stores the client IP. However, since edge nodes mediate requests to an edge application, the header also stores other addresses in the request route in addition to the client IP address.

To isolate the client IP, you must forward it to a new header by creating a rule using Rules Engine for Edge Application.

To send the original client IP through a new request header, follow these steps:

  1. Access Azion Console.
  2. On the top-left corner of the page, go to Products menu, represented by the three horizontal lines, and under the BUILD section, select Edge Application.
  3. Select the edge application you want to apply the solution to.
  4. Click the Rules Engine tab > select the Default Rule.
  5. In the Behavior section, click the + button.
  6. In the new behavior field, select Add Request Header.
  7. In the argument field, add the following string: X-Client-IP:${remote_addr}
  8. Click the Save button.

After completing the alteration in Rules Engine, the IP address of the client that originated the request will be added to the X-Client-IP header.


Contributors