Frappe Bench on-premise Server

Hello Frappe enthusiast, I have a scenario for an on premise server infrastructure, that infrastructure is hosting multiple web apps some on .Net, php (WordPress) and similarly a Ubuntu virtual machine for hosting frappe bench. We can access ERPnext and other web apps from intranet within organisation, to access from outside We setup domain with static IP for example mydomain.com. We have also set firewall on server and only allow specific ports for each web app, e.g. mydomain.com:7000 is used .Net application, same way we reserved a firewall port for erpnext let’s via mydomain.com:5000 so that user from outside can access erpnext from Internet. I added above custom domain (mydomain.com:5000) in site config but it seems not working.
A) I added custom domain via bench add-domain but It didn’t updated nginx.conf in config folder of frappe bench.
B) Then i added same domain manually in nginx.conf in server directive but still it’s not working.

It will be very helpful If anyone can guide my to setup right configuration so that we can access physically private sever frappe instance from internet ?

You can try to add the domain to the site_config.json file, like this:

"domains": [
  {
   "domain": "mydomain.com",
   "ssl_certificate": ...,
   "ssl_certificate_key": ...
  }
]

and then run bench setup nginx and sudo service nginx reload.

There is no need to update the nginx.conf file, you just update the site_config.json and then these commands will update the nginx.conf file.

Yes i added static IP in host_name and also custom domains in domains list but its not working. It seems some additional configuration of nginx or VM firewall is required

To configure Nginx to recognize multi-site setup, navigate to your frappe-bench directory and run these commands:

bench config dns_multitenant on
bench setup nginx
sudo service nginx reload

These commands will setup nginx to create listeners for multiple sites in your bench.

I hope this helps.