In Oracle Cloud, you can pass through the actual client IP from a load balancer by configuring the load balancer to use the “Client IP” option for the “IP Mode” setting.
Here are the steps that we followed to configure the load balancer to pass through the actual client IP:
Log in to the Oracle Cloud Console.
Navigate to the Load Balancing service.
Select the load balancer that you want to configure.
Create Rule Set:
Use:
CLIENTIP
{X-Forwarded-For}
Monitor the work requests for rule set to update and when rule set update is over then move forward.
Next Modify the Listener:
Monitor the work requests until it completes.
Next, you will need to modify the “LogFormat”in the httpd.conf on the webserver so that it start writing the incoming header value to the access log
It should be something like the below:
Changing from
LogFormat “%h %l %u %t \”%r\” %>s %b”
to below
LogFormat “%{X-forwarded-for}i %l %u %t \”%r\” %>s %b”
In case you are using Oracle EBS then you can modify the below file in both RUN and PATCH editions:
$FMW_HOME/webtier/instances/<s_ohs_instance>/config/OHS/EBS_web/httpd.conf
CHANGE:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common
TO BELOW:
LogFormat "%{X-forwarded-for}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%{X-forwarded-for}i %l %u %t \"%r\" %>s %b" common
- Building a Scalable and Secure AI Infrastructure in the Cloud - May 12, 2024
- Harnessing the Power of AI in the Cloud for Business Transformation - March 2, 2024
- Building a Resilient Cybersecurity Framework in the Oracle Cloud - January 16, 2024