I have hosted a podcast from my MIAB static file service. It’s great, but I’m moving the files to a commercial host. I receive mail to this domain and use the calendar and contacts. I cannot do a full redirect of the domain.
I’m trying to redirect a single file.
http(s)://mydomain.com/mydomainrss.xml to some.otherhost.com/mydomainrss
This is all that I want to achieve - 301 that request for domainrss.xml to the new host.
/home/user-data/www contains all of the site content directories for my domains, including mydomain.com. I created a file /home/user-data/www/mydomain.com.conf with the line:
My understanding is that this new mydomain.com.conf should NOT contain a sever block, but can contain a subset of directives that are normally found in an NGINX server block.
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
sudo /installlocation/mailinabox/tools/web_update
I then did sudo systemctl restart nginx and that results in an unexpected redirection to https://mydomain.com/some.otherhost.com/mydomainrss.
Go to MIAB Admin panel >> Custom DNS>> Make A record >> IPV4 of some.otherhost.com.
Refrain from messing up the nginx config. MIAB is supposed to handle external hosts this way. I am not sure when your permanent redirect will expire now that it propagated. Even if you delete it. This is why a temp redirect is used.
Please note that with the automatic Certificate renewal and provisioning Let’s Encrypt when it hits the redirect will not provision or renew the certificate on the other host. You must provision the https certificate on the other host yourself manually, depending on the other host setup.