当用户登录 nginx 位置时发送电子邮件

当用户登录 nginx 位置时发送电子邮件

是否可以指示 nginx 在用户登录特定位置时发送电子邮件?

服务器和位置如下:

    server {
    listen 443 ssl;
    server_name myserver.com;
    root /data;
    index   index.php index.htm index.html;
    ssl_certificate  /var/www/certificates/whatever_combined.crt;
    ssl_certificate_key  /var/www/certificates/whatever.com.key;
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout 5m;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    #Heizungskeller web site 
    location /heizungskeller {
        access_log logs/heizungskeller.access.log heizungskeller if=$loggable;
        error_log logs/heizungskeller.error.log;
        auth_basic "Please enter userid and password for the heating controls";
        auth_basic_user_file  .htpasswd_heizung;
        allow all;
        autoindex on; 
        index   heizung.htm;
        }
    }

我想知道是否有任何方法可以在用户成功登录到 /heizungskeller 位置时触发电子邮件。

答案1

一个想法:
使用一些隐藏的标签(如 index.html 中的图像)来“标记”访问。稍后,您可以使用任何工具检查日志,例如日志冲浪者

相关内容