投稿

ラベル(Apache httpd)が付いた投稿を表示しています

How to set X-Forward-For on Apache httpd

I think you want to use X-Forwarded-For when you use a load balancer. Because the IP address acquired by the web server becomes the IP address of the load balancer. In this article I will show how to restrict IP using X-Forwarded-For and how to output X-Forwarded-For to the log. Apache httpd introduced in this article is installed based on chef. X-Forwarded-For logging Restrict IP with X-Forwarded-For X-Forwarded-For logging vim /etc/httpd/conf/httpd.conf Create a custom log definition called "combined" . LogFormat " %h %l %u %t \" %r \" %> s %b \" %{Referer} i\" \"%{User-Agent}i\"" combined ↓ LogFormat " %h %l %u %t \" %r \" %> s %b \" %{Referer} i\" \"%{User-Agent}i\" \"%{X-Forwarded-For}i\"" combined vim /etc/httpd/sites-enabled/000-default 000-default is the file setting VirtualHost. Set to use combined. CustomLog / var / log ...