Re: Писать в лог доступ к определенным ссылкам

IvanMiller nginx-forum на forum.nginx.org
Вс Фев 21 05:29:35 UTC 2016


Любое совпадение.

http {
map $request:$http_referer:$uri $confirm {
        "~^/mail_confirm/:/mydomain-e.com/mail_confirm/:mail_confirm" 1;
        default 0;
   }

    server {

        listen       *:443 ssl spdy;
        server_name mydomain.com www.mydomain.com;

        ssl                  on;
        ssl_certificate         /ssl/mydomain.com.crt;
        ssl_certificate_key     /ssl/mydomain.com.key;
        ssl_session_timeout  16m;



        ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers   on;

#       access_log  /var/log/nginx/mydomain.access.log  main;
#       access_log  /var/log/nginx/mydomain.access.cf.log cf_custom;
        error_log /var/log/nginx/mydomain.error.log;
        access_log  /var/log/nginx/mydomain.access_confirm.log main
if=$confirm;

        location ~* ^.+\.(jpg|jpeg|gif|png|ico|js|css)$ {
                add_header cache-control "max-age=3600, must-revalidate";
        }

        location /server-status {
            stub_status on;
        }

        root   /www/mydomain.com;
        index  index.html index.htm index.php;

        if (!-e $request_filename) {
              rewrite ^ /index.php last;
        }
        location /refac {
            if (!-e $request_filename) {
                rewrite ^ /refac/index.php last;
            }
        }
      
        location ~ \.php$ {
                include php.domain.conf;
        }

        location ~ \.php(.*)$ {
            include php.domain.conf;
    }
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?21,264614,264679#msg-264679



Подробная информация о списке рассылки nginx-ru