I’m currently experiencing an issue with Nginx and my 2nd domain. I have a vps hosted on Hostinger and both of my 2 domains are pointing on it. The problem is that with my 2nd domain, I get a ERR_EMPTY_RESPONSE when trying to access it via web browser or curl: (52) Empty reply from server.
I simplified as much as I can the nginx config to lower down the issue but I always have the same problem.
This is my nginx config :
server {
listen 80;
server_name 194.164.XX.XXX www.domain2.com domain2.com domain1.com www.domain1.com;
location / {
return 200 'Hello, Nginx is working !';
add_header Content-Type text/plain;
}
}
I have access to the Hello message when accessing it via IP address, domain1.com and www.domain1.com but not using the domain2.
I also used dig to verify that the 2nd domain is correctly pointing my vps and it’s the case :
; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> domain1.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44540
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;domain1.com. IN A
;; ANSWER SECTION:
domain1.com. 2162 IN A 194.164.XX.XXX
;; Query time: 3 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Sun Jun 30 11:03:55 UTC 2024
;; MSG SIZE rcvd: 57
I have no idea where this could come from, any help would be really appreciated.
Thanks in advance.