Is Frappe Backend Domain-Agnostic? Concerns with Multiple Domains Pointing to the Same Site

Hello everyone,

I have a scenario where I need to access the same Frappe backend from two different domains (e.g., abc.com and cdf.com). Both domains should route to the same site, and I plan to handle this through Nginx by configuring both domains to point to the same server.

I have a few questions regarding this setup:

  1. Is Frappe completely domain-agnostic by default?

    • I understand that Frappe relies on site_config.json for site-specific settings. However, does Frappe itself introduce any domain-specific logic that might cause issues if multiple domains point to the same backend?
  2. Does having a host_name in site_config.json restrict multi-domain access?

    • If the host_name is set to abc.com in site_config.json, will cdf.com be able to function properly? Is there a best practice here for handling multiple domains?
  3. Will this setup impact site-specific URLs or routing?

    • For example, would accessing /desk or API endpoints work seamlessly across both domains, or could this setup cause routing issues in Frappe?
  4. Has anyone faced challenges or issues when working with multiple domains on the same Frappe site?

    • Are there any pitfalls or gotchas to be aware of, particularly around SSL, site isolation, or other domain-related concerns?

Any insights, suggestions, or experiences would be greatly appreciated!

Thank you in advance!

Frappe framework is pretty friendly with any scenario you'd apply with a healthy mind. Say, you'd like a site but you need to expose them under different names or extensions using SSL, just execute the following preferably under the bench directory from the beginning. Before you start check if you have certbot installed under apt package management. If it is present, remove it:

sudo service nginx stop
sudo snap install certbot --classic
sudo ln -s /snap/bin/certbot /usr/bin/certbot
Don’t produce any certificates but you can check installation by typing:
sudo certbot certonly --standalone
sudo service nginx start
bench new-site sitename
bench config dns_multitenant on
bench setup add-domain --site sitename DOMAIN
sudo bench setup lets-encrypt --custom-domain DOMAIN sitename
You’re probably good to go…

Hi @Tufan_Kaynak2:

Check site_config.json As far I know, host_name value is being used to obtain url if it is defined there. Otherwise it will be getted from sitename.

(It would affect to email footers, etc …)