ERPNext access by wan issue!

hello
thanks for helping in advance .
i can access my erpnext production website by lan by entering the ip address of the ubuntu pc which has the erpnext installation .
i want to access it by wan . i asked my ISP for static ip and i got it . but when i open the static ip it opens the router page .
how i configure the static ip to the erpnext website ?

You need to forward the port(s) on the router [in the case of a standard production server, port 8000] to the IP address of the server on the LAN

thanks for your reply .
i did it but it’s not working .
first of all the erpnext pc is 192.168.1.200
i access it by lan by 192.168.1.200:80 not :8000
but any way i setup the DMZ host to 192.168.1.200
and port forwarding i tried to open 8000 but when i try to access the wan ip address . it opens the router page ! and it’s not working for port 80 too !

You cannot have the router AND the ERPNext server on the same port. The router will take the first available port match and send the packets there. This means you either have to change the port on ERPNext, or on the routers web-management page

1 Like

Thanks for your reply .
I changed the erpnext port and now i can only access it by 192.168.1.200:8989 .
I made the port forwarding to this ip with the port .
But i still getting the router page when i enter my wan address !

I don’t know this router - what is the
WAN Connection: We?

Yeah . It’s the right wan connection name “WE” .
I check the open ports online and i found that 8989 is already open . But when i enter my wan adress xx.xx.xx.xx it opens the router page .
When i enter the wan ip with the opened port xx.xx.xx.xx:8989 . It gives me an error page .

I did this once several years ago and I believe I had to make the server connection on the router a DMZ port directly to the outside world bypassing the NAT firewall.

Even then it was touchy getting it to work right.

Sorry, it has been quite a while since I tried hosting back out to the world from inside my network, but my memory tells me it was done with a DMZ definition in the router.

BKM

Whats the name of the router you are using. Usually you can leave the server on the default port 80 and then use your router for the translation from another port of your choice on the public IP which should not be port 80

Thanks for helping .
I already opened the connection of the DMZ to the erpnext ip but it didn’t make and difference .

It’s ZTE H108N . I didn’t get it ! How can i do that ?

All your router configuration seem ok but if you have forwarded port 8989 then can you make sure that nginx is listening on that port by stating that in the file /etc/nginx/config.d/frappe-bench.config depending on your distribution. Or before you change that config file, forward 8989 to 80 on the lan side in the router. That should work for you.

Nginx is listening to the port cause i can only access the erpnext website by 192.168.1.200:8989
Is that what you mean ?

i forwarded the port 8989 to 80 and there is no effect it’s the same !

this is frappe-bench.config .

upstream frappe-bench-frappe {
server 127.0.0.1:8000 fail_timeout=0;
}

upstream frappe-bench-socketio-server {
server 127.0.0.1:9000 fail_timeout=0;
}

setup maps

server blocks

server {
listen 8989;
server_name
site1.local
;

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

Closing this thread, continues here ERPNext access by wan problem