[Solved] Change Url from Public IP to Domain Name

Hi. I’ve gone through several posts on how to change ERPNext url but none seems to give me particular direction.

I have my ERPNext deployed on an EC2 (Amazon Web Services) server. I can only access my instance via live public IP. I’ve created a subdomain erp.mydomain.com and resolved it to my live ip. however, in doing this, the url on my browser changes to the live IP. I’ve also tried changing the site name to mydomain.com from site1.local and modified all references in common_site_config.json and others. In doing so however, i lose access to my ERPNext apps as i get a “Sorry, we’ll be back soon” page.

I want to change the url on the home page from the live ip of the server to erp.mydomain.com. I want to also change the references in the email and other docs to mydomain.com rather than site1.local. Can someone tell me how to achieve this if at all it’s possible? I would really appreciate it if someone can point me to how this can be done.

What is your Route 53 setting? does it point the sub domain name to the IP?

@iadr3805 I tried to set up route 53 using guides found online but no luck in getting the configuration to resolve. I would appreciate if you can point me to a guide to do this (i’m pretty new at all of these so i hope you don’t mind).

Hi @flexy2ky ,
Please specify the Domain name in your nginx conf file which is under config folder
server_name:domain_name this changes done in nginx.conf file and reload the nginx service.
please check the domain_name is point out to your server.

Thanks

@segar I already did that. This is a page lift of my nginx.conf file:

upstream frappe-bench-frappe {
server 127.0.0.1:8000 fail_timeout=0;
}
upstream frappe-bench-socketio-server {
server 127.0.0.1:9000 fail_timeout=0;
}

setup maps

server blocks

server {
listen 80;
server_name
mydomain.com
2,17 Top

did i miss something?

@sagar after much research, i found the solution. It was pretty simple after all to replace the public IP to domain url on AWS. However, I had to fuse instructions from several guides to know exactly what to do.