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

Hi,

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.

Hi,

Please run the following command to setup production environment.

sudo bench setup production

Thanks,

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

Hi,

In that case configure Apache:

<VirtualHost *:80>
ServerName example.domain.com
ServerAlias example.domain.com
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://example.domain.com:8002/
ProxyPassReverse / http://example.domain.com:80>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
<Location />
Require all granted
</Location> 
</VirtualHost>

Please change the example domain name with your domain name.

Thanks,

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.