ERPNext working with domain but not with IP

Hello!

I have an issue with ERPNext accessing via IP address. Accessing it with domain works fine, no issues. With the corresponding IP, it displays the “Sorry! We will be back soon.” with a certificate error. Found no solution. Have tried many commands found on various threads, all are up and running. Tried to disable fail2ban, the issue persists.

I think it’s the culprit that the woocommerce intergration doesn’t work, giving 500 and 403 errors on new orders on webhook logs.

All ports are open (80, 8000, 8080, 23/22, 3306)

Details:
ERPNEXT: v11 . x . x-develop (03b5974) (develop)
Ubuntu 16 on AWS
DNS Route53 all configured.
Frappe and ERPNext installed using my domain site name

Error logs of erpnext:

IP - - [09/Aug/2018:07:15:22 +0000] “GET / HTTP/1.1” 502 5444 “-” "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/$
IP - - [09/Aug/2018:07:15:23 +0000] “GET /favicon.ico HTTP/1.1” 502 5444 “https : //IP/” "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.$
IP - - [09/Aug/2018:07:15:26 +0000] “GET / HTTP/1.1” 502 5444 “-” "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/$
IP - - [09/Aug/2018:07:15:26 +0000] “GET /favicon.ico HTTP/1.1” 502 5444 “https : //IP/” "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.$
IP - - [09/Aug/2018:07:24:29 +0000] “GET / HTTP/1.1” 502 5444 “-” "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/$
IP - - [09/Aug/2018:07:24:30 +0000] “GET /favicon.ico HTTP/1.1” 502 5444 “http s: //IP/” "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.$

If you setup a Lets Encrypt ssl cert, then you have your reason. The cert only applies on the domain, not on the IP. Therefore nginx wont let you connect, because it’s setup to only except ssl secured traffic, which your connection though the IP is not.

1 Like

Is there any solution or this is normal?

I have set in nginx to 301 redirect with server_name my IP, but it doesn’t seem to be working after restarting nginx.

Total newb question because while I have seen sites loading with cert error with IP, but this is something new to me (the reason of 502 error).

Thanks!

server_name www.our-domain.com our-domain.com www.our-domain.ie our-domain.ie 192.168.1.xxx
in the conf file might work

This is (according to my understanding) completely normal. If your ssl cert includes your IP then this shouldn’t be a problem. But I’m assuming that you are using let’s encrypt, which doesn’t certify IP Address.