I am trying to set up a webserver that would handle requests with any “Host” header. The gist of nginx config looks like this:
listen 80 default_server;
listen 443 default_server ssl;
I set up a subdomain CNAME pointing to that server and it works for that (i.e., TEST_DEFAULT_DOMAIN).
However, when we tried setting up a CNAME for a different domain not hosted by cloudflare, OTHER_DOMAIN, opening it returns error 1001 by cloudflare.
Below is my troubleshooting so far:
dig OTHER_DOMAINlooks good:
;; ANSWER SECTION:
OTHER_DOMAIN. 4144 IN CNAME DEFAULT_DOMAIN.
DEFAULT_DOMAIN. 300 IN A 220.127.116.11
DEFAULT_DOMAIN. 300 IN A 18.104.22.168
DEFAULT_DOMAIN. 300 IN A 22.214.171.124
curl <origin-IP> --basic --user "user:pass" --header "Host: OTHER_DOMAIN"looks good too:
Result is html produced by the origin server. As far as I understand, it means that the origin server is configured properly.
curl DEFAULT_DOMAIN --basic --user "user:pass" --header "Host: OTHER_DOMAIN"produces error 1001. Apparently it means, that the error is caused by cloudflare in some way.
curl DEFAULT_DOMAIN --basic --user "user:pass" --header "Host: TEST_DEFAULT_DOMAIN" works well and produces the expected result.
curl OTHER_DOMAINor opening OTHER_DOMAIN in a browser also results in error 1001. It makes me think, that CNAME is configured properly.
I also tried removing basic authentication from the origin server to no avail.
Any suggestions please?
Thank you in advance!