Welcome! Log In Create A New Profile

Advanced

proxy server

Posted by iaintarrant 
proxy server
December 02, 2016 02:13AM
Hi guys,

I have a webmail service running on a Debian virtual server (iRedmail and roundcube) which is working fine, but I have been unable to get nginx to play nicely whilst adding other subdomains.
So I setup another Debian host on the same machine which is serving my main website and another subdomain through apache2.
What I would like to do, which is now half working, is setup a proxy using apache as the front end with a subdomain pointing to the nginx webmail server. I have configured apache and it now redirects traffic to the nginx server, but either something needs changing in nginx or the config from iRedmail isn't allowing it.

Listening on port 80 and getting a request the config tells it to rewrite if not secure:
# Redirect webmail/SOGo/iredadmin to HTTPS
location ~ ^/mail { rewrite ^ https://$host$request_uri?; }

Listening on port 443 and getting a request the config points to the mail directory:
# Roundcube webmail
location ~ ^/mail(.*)\.php$ {
include fastcgi_params;
fastcgi_pass php_workers;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /opt/www/roundcubemail$1.php;
}

location ~ ^/mail(.*) {
alias /opt/www/roundcubemail$1;
index index.php;
}

Locally using the machine ip address I can open the webmail page and all works well. But if I try using the external address I get "This site cannot be reached", and I know it has reached the nginx server because the address has been rewritten from mail.example.com to https:mail.example.com/mail.

Can anyone help me?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 115
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready