Hi,
I am sorry if there is a topic covering this already but I have been unable to find anything after hours of searching. Or maybe I was unable to recognise that which I need. I am setting up a VM test mail server using the iRedMail package and having problems reverse proxying to the two default web UIs the package creates.
Running locally the server creates two web UIs at https://192.168.0.2/mail and https://192.168.0.2/iredadmin both of which are accessible. Now my big problem is using two separate hosts to access these two local sub-domains.
My first problem I have encountered is that the reverse proxy seems to redirect requests from host.example.com to http://local.ip/host automatically. Where the host name seems to be appended on the end of the local ip.
Such that my config of:
server {
listen 80;
servername mail.example.com;
location / {
proxy_pass https://192.168.0.2/mail;
}
returns an error that the domain mail.example.com/mailmail does not exist. I have also tried with the proxy pass having /mail/ on the end but this returns an error saying mail.example.com/mail/mail does not exist. Which made me realise that for some reason the host name is being appended onto the end of the domain as a sub-domain.
What am I missing or needing to read into about how nginx is appending the hostnames into the proxy pass?
Thank you.