Setup Nginx for erpnext on port 81

How can i have Nginx to listen for erpnext from ports 81 beyond and setup the port 80 for a normal http page managed by nginx or other … for instance i would like my local page to be on page 80 but with not erpnext access or settings from it and when the user selects or types port 81 nginx will route to erpnext sites?

Maybe this link can help you out with that:

Port Change Command

By the way check also the documentation for more details:


Good luck!

@yefritavarez thanks for the reply but this i already know … my problem is to have the port 80 for a normal webpage to load without even going to frappe or erpnext directories …
this to avoid the Encode and Decode errrors i have been getting… so the idea is on the same server with erpnext installed to have the 80 for websites and the ports 81 forward to handle erpnext applications…

I am not much into nginx.

@pdvyas can you help?

change erpnext port to 81 using this command
bench set-nginx-port site-name 81
bench setup nginx

and then add new conf file inside /etc/nginx/conf.d/

server {
        listen 80;
        root /usr/share/nginx/www; #change this to your html location
        index index.html index.htm;

        server_name localhost;

        location / {
                try_files $uri $uri/ /index.html;

and restart nginx
sudo service nginx restart

1 Like

@lukptr thanks for the tips… This is what I have done after reading a bit. Thanks anyway for the support and is good to know that we can always count with our global support.
As a minor doubt, should a normal webserver be a standalone and the app (ERPNext) another server in terms of security and risks reduction? As if an attack is do to the webserver the app will keep running…