Unwanted web redirect

Sorry to be asking, I read everything similar here, and I’m still stuck.

I have several domains setup the same, with MIAB over on one box and webservers (WordOps) on a separate box. Both boxes are hosted at Racknerds (which is a white label of Amazon, afaict). I have 2 external DNS servers on separate boxes and all the pointers are setup the same for all domains.

I setup the Custom DNS on MIAB to point to the webservers with A records like this
www.domainx.ca A 23.95.xxx.yy [delete]

If I understand correctly, the reason you must do this is so that MIAB won’t hog the www subdomain when it goes to provision LetsEncrypt certificates, since I’m using external DNS under my control pointed to by the domain registrar.
I did not use the auto LE provisioning of WordOps, but instead manually provisioned the LetsEncrypt certificates for each www.domainXXX.ca.

When you try http://www.domain111.ca it redirects to the https site, as desired. However when you try http://www.domain222.ca it redirects Incorrectly to the MIAB box.

I have setup the WordPress Options|siteurl and Options|home fields with both http:// and https:// during testing with no noticeable difference in outcomes.

I can’t see any differences between the MIAB (box1) and nginx WordOps (box2) webserver configurations! Ugh.

I can’t figure out where the misconfiguration is… any ideas would be welcome.

btw, Mail for all domains is working properly, thanks for great MIAB product :slight_smile:

The default minimum TTL in MiaB is 86400 for all records. Have you tried checking the record from a location with a different DNS server?

Both servers and the DNS has been setup weeks ago… so TTL would have timed out, also note, I am using external DNS servers completely under my control, so In my mind anyways, MIAB DNS should have nothing to do with anything other than the MIAB LE provisioning.

That gives me an idea though, there are websites like https://www.whatsmydns.net and https://dnsviz.net/ that I’ve used before to debug… I better have a look at them and see if there’s anything that stands out. thx.

I’m thinking that it’s some kind of misconfiguration or quirk of nginx. I think what must be happening is… http request comes to webserver, then the webserver, for unknown reasons, bounces the request over to the mail server,
if an https request comes to the webserver, it redirects to the “base” website of the nginx server… the first server block of nginx… I don’t always get nginx pattern matching rules :frowning:
does anybody?

I think I know what MAY be happening – but I do not have time now unfortunately to check my theory. I will be available in about 8 hours. Please DM me your MiaB hostname and the domain name(s) that are a problem, so I can check.

Hi, Alento, Did you have a chance to look at my message, or have any comments regarding the unwanted web redirect?

DNS … it is always in the DNS, unless it isn’t. :slight_smile:

Hey, I’m just going to add a note … I can see quite clearly now that the root domain A record should have been pointing to the webserver.

If you use the MIAB box to host BOTH the mail and web servers for a domain then your key DNS records should be something like this:

$ORIGIN example.com
IN A ← MIAB IP address
IN MX 10 mail.example.com
mail IN A ← MIAB IP address
www IN A ← MIAB IP address

BUT if you host your webserver elsewhere your key DNS records should be like this:

$ORIGIN example.com
IN A ← Webserver IP address
IN MX 10 mail.example.com
mail IN A ← MIAB IP address
www IN A ← Webserver IP address

I hope this can be of use to others. Also, please correct me if I’m wrong about any of this…

This topic was automatically closed 40 days after the last reply. New replies are no longer allowed.