i have the following entries in my nginx.conf, this allows me to go to http://somerandomstuff.domain.ie, which my app_subdomain_handler application then handles, this works ok.
upstream app_subdomain_handler {
server 127.0.0.1:5001;
keepalive 8;
}
server {
listen 0.0.0.0:80;
server_name *.domain.ie;
location / {
proxy_pass http://app_subdomain_handler/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
}
}
server {
listen 443 ssl;
server_name *.domain.ie;
location / {
proxy_pass http://app_subdomain_handler/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
}
}
my problem is that if i add a dns TXT record, say for test.domain.ie, the app_subdomain_handler never recieves the request. I've checked via tcpdump, using
tcpdump port 80 -s 0 -w capture.cap
and nginx never sees the request. test.domain.ie returns a Server not found message in the browser.
i use linode for hosting and nameservers, there are multiple TXT records, any ideas? Why does the TXT record cause the subdomain not to resolve?
dig test.domain.ie
output?A
records fortest.xbt.ie
, which seems like it'd be the cause of your problem. You can have bothA
andTXT
coexisting for the same domain/subdomain.A
record is necessary for a domain to resolve to an IP address.TXT
records have nothing to do with that. Some situations require aTXT
(like SPF records). Some situations require anA
(like wanting people to get to a website). You can haveA
,TXT
, or both. They have different purposes.