I have 2 webservices installed on my mailserver.
- Roundcube /var/www/roundcube
- Mail Admin Tool /var/www/mailAdmin (for postfix, dovecot configuration)
Additionally the Apache2 of the mailserver is hidden behind a nginx reverse proxy.
My question is, how do i configure Apache to map all http://mail.example.org/ request to my /var/www/roundcube
folder and all http://mail.example.org/mailadmin requests to the /var/www/mailAdmin
folder.
I wrote the following configuration.
But the problem with this is that every request is mapped to /var/www/roundcube
and if i request http://mail.example.org/webadmin Apache tries to access /var/www/roundcube/mailadmin
.
I could do a ln -s
at this point but this doesn't feel right or is it?
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example.org
ServerAlias mail.example.org
DocumentRoot /var/www/roundcube/
<Directory />
Options FollowSymLinks
AllowOverride Nonedevcontrol
</Directory>
<Directory /var/www/roundcube>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
The configuration of the reverse proxy is:
server{
listen 80;
server_name mail.exampole.org;
rewrite ^ https://mail.example.org$request_uri? permanent;
}
server {
listen 443;
server_name mail.example.org;
access_log /var/log/nginx/access.mail.log;
error_log /var/log/nginx/error.mail.log;
###SSL###
include w.example.org.conf;
# proxy to Apache 2 and mod_python
location / {
proxy_pass http://192.168.1.200:80/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_max_temp_file_size 0;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}