{"id":26081,"date":"2023-02-20T07:40:10","date_gmt":"2023-02-20T07:40:10","guid":{"rendered":"http:\/\/localhost\/helpold\/?p=26081"},"modified":"2025-01-02T13:11:26","modified_gmt":"2025-01-02T09:41:26","slug":"log-visitors-actual-ip-addresses","status":"publish","type":"post","link":"https:\/\/www.arvancloud.ir\/help\/en\/log-visitors-actual-ip-addresses\/","title":{"rendered":"How to Log Visitors\u2019 Actual IP Addresses in Webservers"},"content":{"rendered":"<p style=\"text-align: left;\">As ArvanCloud\u2019s network uses the reverse proxy method, when you check the visitors\u2019 IP addresses, you will see ArvanCloud\u2019s IP address. ArvanCloud keeps the actual IP addresses of the visitors in a specific field of the HTTP headers. In this article, we will discuss the way to log these actual IP addresses in Apache, Nginx, and IIS.<\/p>\n<h2 style=\"text-align: left;\">How to Log Visitors\u2019 Actual IP Addresses in Nginx<\/h2>\n<p style=\"text-align: left;\">To find the actual IP addresses, add headers with the following format to Nginx:<\/p>\n<pre><code>log_format test1 \u2018\u2026 $http_x_real_ip $http_ar_real_ip $http_x_real_ip\u2026\u2019<\/code><\/pre>\n<p style=\"text-align: left;\">And then use the log format:<\/p>\n<p style=\"text-align: left;\"><code>access_log test1<\/code><\/p>\n<p style=\"text-align: left;\">As an instance:<\/p>\n<pre dir=\"ltr\"><code>log_format test1 '$http_x_real_ip - $remote_user [$time_local] '\r\n'\"$request\" $status $body_bytes_sent' \r\n'\"$http_referer\" \"$http_user_agent \"$http_ar_real_ip\" \"$http_x_real_ip\"';<\/code><\/pre>\n<h2 style=\"text-align: left;\">How to Log Visitors\u2019 Actual IP Addresses in Apache<\/h2>\n<p style=\"text-align: left;\">In Apache, you need to add the following values to your log format:<\/p>\n<pre dir=\"ltr\"><code>\"%{X-Forwarded-For} %{X-Real-Ip} %{x-real-ip}i\"<\/code><\/pre>\n<p style=\"text-align: left;\">A simple log format in Apache looks like the following:<\/p>\n<pre dir=\"ltr\"><code>LogFormat \" %h %l %u %t \"%r\" %&gt;s %b %{X-Forwarded-For} %{X-Real-Ip} %{x-real-ip}i\" test1<\/code><\/pre>\n<h2 style=\"text-align: left;\">How to Log Visitors\u2019 Actual IP Addresses in IIS<\/h2>\n<p style=\"text-align: left;\">Follow this instruction to log the actual IP addresses in IIS:<br \/>\nGo to: IIS Config &gt; Logging<br \/>\nChoose Select Fields<br \/>\nClick on Add Field<br \/>\nAdd the following headers:<br \/>\n<code>x-real-ip<br \/>\nX-Real-Ip<br \/>\nX-Forwarded-For<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As ArvanCloud\u2019s network uses the reverse proxy method, when you check the visitors\u2019 IP addresses, you will see ArvanCloud\u2019s IP address. ArvanCloud keeps the actual IP addresses of the visitors in a specific field of the HTTP headers. In this article, we will discuss the way to log these actual IP addresses in Apache, Nginx, [&hellip;]<\/p>\n","protected":false},"author":79,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"r1_post_views_count":"1150","feedback_yes":"0","feedback_no":"0","ads_id_sidebar":"","ads_id_content":"","footnotes":""},"categories":[249,255],"tags":[],"class_list":["post-26081","post","type-post","status-publish","format-standard","hentry","category-cdn","category-cdn-setting"],"lang":"en","translations":{"en":26081},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/users\/79"}],"replies":[{"embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/comments?post=26081"}],"version-history":[{"count":2,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26081\/revisions"}],"predecessor-version":[{"id":28269,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26081\/revisions\/28269"}],"wp:attachment":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/media?parent=26081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/categories?post=26081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/tags?post=26081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}