Answer the question
In order to leave comments, you need to log in
Why can't apache with mod_remoteip detect some ips correctly?
Apache is running nginx on the server. The mod_remoteip module works in Apache. Usually in Apache logging settings I have the following config:
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
95.216.144.51 - - [07/Mar/2022:18:13:43 +0300] "-" 408 0 "-" "-"
95.216.144.51 - - [07/Mar/2022:18:13:43 +0300] "-" 408 0 "-" "-"
95.216.144.51 - - [07/Mar/2022:18:13:43 +0300] "-" 408 0 "-" "-"
95.216.144.51 - - [07/Mar/2022:18:13:44 +0300] "-" 408 0 "-" "-"
95.216.144.51 - - [07/Mar/2022:18:13:44 +0300] "-" 408 0 "-" "-"
95.216.144.51 - - [07/Mar/2022:18:13:44 +0300] "-" 408 0 "-" "-"
server {
listen 95.216.144.51:80;
server_name vincent1.ru www.vincent1.ru;
error_log /var/log/apache2/domains/vincent1.ru.error.log error;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://95.216.144.51:8080;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
root /home/vincent1/web/vincent1.ru/public_html;
access_log /var/log/apache2/domains/vincent1.ru.log combined;
access_log /var/log/apache2/domains/vincent1.ru.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias /home/vincent1/web/vincent1.ru/document_errors/;
}
location @fallback {
proxy_pass http://95.216.144.51:8080;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
include /home/vincent1/conf/web/nginx.vincent1.ru.conf*;
}
netstat -antu
, I see thousands of connections to my server on port 80 from one ip, but this ip is not found anywhere in the Apache logs. Why?tcp 0 0 95.216.144.51:80 137.184.238.68:57500 FIN_WAIT2
tcp 0 0 95.216.144.51:80 143.110.229.58:42830 FIN_WAIT2
tcp 0 0 95.216.144.51:80 141.101.77.138:56758 TIME_WAIT
tcp 0 0 95.216.144.51:80 137.184.238.68:40584 FIN_WAIT2
tcp 0 0 95.216.144.51:80 137.184.238.68:38354 FIN_WAIT2
tcp 0 0 95.216.144.51:80 137.184.238.68:42348 FIN_WAIT2
tcp 0 0 95.216.144.51:80 137.184.238.68:33604 FIN_WAIT2
tcp 0 0 95.216.144.51:80 137.184.238.68:33094 FIN_WAIT2
Answer the question
In order to leave comments, you need to log in
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://95.216.144.51:8080;
location @fallback {
proxy_pass http://95.216.144.51:8080;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question