Commit befdfb2a authored by Marius Burkard's avatar Marius Burkard

- added missing rspamd lines in apps vhost template on install

parent c3e2fd16
Pipeline #1370 passed with stage
in 2 minutes and 41 seconds
......@@ -2226,7 +2226,10 @@ class installer_base {
$tpl->setVar('logging','yes');
}
if($conf['rspamd']['installed'] == true) {
$tpl->setVar('use_rspamd', 'yes');
}
// comment out the listen directive if port is 80 or 443
if($conf['web']['apps_vhost_ip'] == 80 or $conf['web']['apps_vhost_ip'] == 443) {
$tpl->setVar('vhost_port_listen','#');
......@@ -2294,6 +2297,12 @@ class installer_base {
$apps_vhost_ip = $conf['web']['apps_vhost_ip'].':';
}
if($conf['rspamd']['installed'] == true) {
$content = str_replace('{use_rspamd}', '', $content);
} else {
$content = str_replace('{use_rspamd}', '# ', $content);
}
$socket_dir = escapeshellcmd($conf['nginx']['php_fpm_socket_dir']);
if(substr($socket_dir, -1) != '/') $socket_dir .= '/';
if(!is_dir($socket_dir)) exec('mkdir -p '.$socket_dir);
......
......@@ -19,6 +19,12 @@
RequestHeader unset Proxy early
</IfModule>
{tmpl_if name="enable_spdy" op="==" value="y"}
<IfModule spdy_module>
SpdyEnabled on
</IfModule>
{/tmpl_if}
<IfModule mod_php5.c>
DocumentRoot {tmpl_var name='apps_vhost_dir'}
AddType application/x-httpd-php .php
......@@ -68,6 +74,18 @@
</Directory>
</IfModule>
{tmpl_if name="use_rspamd"}
<Location /rspamd>
Order allow,deny
Allow from all
</Location>
RewriteEngine On
RewriteRule ^/rspamd$ /rspamd/ [R,L]
RewriteRule ^/rspamd/(.*) http://127.0.0.1:11334/$1 [P]
{/tmpl_if}
</VirtualHost>
......@@ -208,4 +208,28 @@ server {
alias /var/lib/mailman/archives/public;
autoindex on;
}
{use_rspamd}location /rspamd/ {
{use_rspamd}proxy_pass http://127.0.0.1:11334/;
{use_rspamd}rewrite ^//(.*) /$1;
{use_rspamd}proxy_set_header X-Forwarded-Proto $scheme;
{use_rspamd}proxy_set_header Host $host;
{use_rspamd}proxy_set_header X-Real-IP $remote_addr;
{use_rspamd}proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
{use_rspamd}proxy_pass_header Authorization;
{use_rspamd}client_max_body_size 0;
{use_rspamd}client_body_buffer_size 1m;
{use_rspamd}proxy_intercept_errors on;
{use_rspamd}proxy_buffering on;
{use_rspamd}proxy_buffer_size 128k;
{use_rspamd}proxy_buffers 256 16k;
{use_rspamd}proxy_busy_buffers_size 256k;
{use_rspamd}proxy_temp_file_write_size 256k;
{use_rspamd}proxy_max_temp_file_size 0;
{use_rspamd}proxy_read_timeout 300;
{use_rspamd}
{use_rspamd}location ~* ^/rspamd/(.+\.(jpg|jpeg|gif|css|png|js|ico|html?|xml|txt))$ {
{use_rspamd}alias /usr/share/rspamd/www/$1;
{use_rspamd}}
{use_rspamd}}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment