Browse Source

[Nginx] Modify site to catch failed logins to /rspamd

andryyy 5 years ago
parent
commit
a606f60b54
1 changed files with 11 additions and 0 deletions
  1. 11 0
      data/conf/nginx/site.conf

+ 11 - 0
data/conf/nginx/site.conf

@@ -116,6 +116,16 @@ server {
   }
 
   location /rspamd/ {
+    location /rspamd/auth {
+      # proxy_pass is not inherited
+      proxy_pass       http://rspamd:11334/auth;
+      proxy_intercept_errors on;
+      proxy_set_header Host      $http_host;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_redirect off;
+      error_page 403 /_rspamderror.php;
+    }
     proxy_pass       http://rspamd:11334/;
     proxy_set_header Host      $http_host;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -207,6 +217,7 @@ server {
   include /etc/nginx/conf.d/site.*.custom;
 
   error_page 502 @awaitingupstream;
+
   location @awaitingupstream {
     rewrite ^(.*)$ /_status.502.html break;
   }