How to change hostname to hostname:port for everything in Frappe?


I’m currently using port 8002 for a Frappe site in VPS that has Apache running on port 80. I currently have 2 problems.

  1. URLs of welcome emails are sending users to hostname not hostname:port, so the URLs are broken.
  2. I want to be able to use hostname directly not hostname:port/app/ to access the home page.

I’ve tried to make changes in Nginx.config by adding a proxy, but I don’t know the right way to do it to get both problems solved. Any help?

Thanks in advance.


Please run the following command to setup production environment.

sudo bench setup production


I already have it in production. It’s up and running. I just need to solve the problems I mentioned earlier.


In that case configure Apache:

<VirtualHost *:80>
ProxyRequests Off
<Proxy *>
Require all granted
ProxyPass /
ProxyPassReverse />
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
<Location />
Require all granted

Please change the example domain name with your domain name.


Thank you for your response.

Actually, this redirects the user to the hostname:port, but it doesn’t solve the internal issues such as the usage of the hostname without the port number in the welcome email. I’d appreciate it if you could share how to solve this in Frappe. Thanks again.