ERPNext production, changing port HTTP

Hello guys, I’m setting the ERPNext v7.1 (production) in an alternative HTTP port.
I am using the configuration on port 1280.

Whenever I try to access the address ( and I’m already logged I am directed to default port (80) not being able to connect. I’m redirect to: When not logged in, I am directed to the login screen usually on port (

I use the following commands to setup the HTTP port:

bench set-nginx-port site1.local 1280
bench setup nginx
sudo service nginx reload

Here is my config/nginx.conf:

server {
	listen 1280;
	server_name site1.local;

	root /home/frappe/frappe-bench/sites;

Here is my sites/site1.local/site_config.json:

 "db_password": "xxx...", 
 "db_name": "xxx...", 
 "nginx_port": 1280, 
 "encryption_key": "xxx...", 
 "limits": {
  "space_usage": {
   "database_size": xxx..., 
   "files_size": xxx..., 
   "total": xxx..., 
   "backup_size": xxx...

I’m missing some setting?

Is there anything else in /etc/nginx/ doing that?
default? Or anything else in conf.d/?

You can try adding following to your /etc/hosts file and enter site1.local:1280 instead of site1.local

Hi @revant_one, I used the IP loopback to write this example.
Apparently the problem is when I’m already logged in, the application is redirecting to the default port (80) instead of the modified door.

This is my domain:

Even changing the hosts file, the redirecting to 80 port occurs.

is there a file called /etc/nginx/sites-available/default?

@revant_one, thanks for help.
On file: /etc/nginx/sites-available/default
I change to:

 server {
      listen 1280 default_server;
      listen [::]:1280 default_server;

But still redirecting to the default port (80) if already logged in.


I am facing the same problem. Have your issue fixed?
Do you care to share how to solve it?
Thanks a lot.