[Nginx, SOGo] Set mime type text/plain instead of returning 403 when opening risky attachments

master
andryyy 2021-05-17 21:21:35 +02:00
parent 8f52068523
commit 1cd0a96ad0
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 12 additions and 1 deletions

View File

@ -177,7 +177,18 @@
location ^~ /SOGo { location ^~ /SOGo {
location ~* ^/SOGo/so/.*\.(xml|js|html|xhtml)$ { location ~* ^/SOGo/so/.*\.(xml|js|html|xhtml)$ {
return 403; include /etc/nginx/conf.d/sogo_proxy_auth.active;
include /etc/nginx/conf.d/sogo.active;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header x-webobjects-server-protocol HTTP/1.0;
proxy_set_header x-webobjects-remote-host $remote_addr;
proxy_set_header x-webobjects-server-name $server_name;
proxy_set_header x-webobjects-server-url $client_req_scheme://$http_host;
proxy_set_header x-webobjects-server-port $server_port;
proxy_hide_header Content-Type;
add_header Content-Type text/plain;
break; break;
} }
include /etc/nginx/conf.d/sogo_proxy_auth.active; include /etc/nginx/conf.d/sogo_proxy_auth.active;