server {
listen 192.168.1.105:80;
server_name domain.com;
access_log /var/www/httpd-logs/domain.com_http.access.log;
location / {
return 301
https://$host$request_uri;
}
}
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
map $request_uri $loggable {
default 1;
~*\.(ico|css|js|gif|jpg|jpeg|png|svg|woff|ttf|eot|bot|Bot)$ 0;
}
map $http_user_agent $exbot_com {
~Pingdom 0;
~Sogou 0;
~AhrefsBot 0;
default 1;
}
map $remote_addr $log_ip {
"192.168.0.0/16" 0;
default 1;
}
server {
listen 192.168.1.105:443 ssl http2;
server_name domain.com;
access_log /var/www/httpd-logs/domain.com.access.log compression if=$loggable if=$exbot_com if=$log_ip;
...... и т.д.
}