Nginx not listening to hostname anymore

Hi all,

my server is local
My nginx was listening to the requests from the web via
erp.example.com” which is C-named to my local network via our hosted webserver
where “example.com” is our domain.
however when being local everyone just used
https://erp
“erp” is the servers hostname
hence I assume nginx just listened to the port and redirected to the erpnext site.

Today did

bench setup nginx

now when calling
https://erp
I get the following response from nginx

Not Found

./erp/site_config.json does not exist

what can I do??

@spa you will need to set default your erp.domain.com site as default site.

$ bench use erp.example.com
OR
$ bench set-default-site erp.example.com
$ bench setup nginx
$ bench restart

SSL without domain name is tricky thing you will need to manually edit nginx.conf file as well as /etc/hosts file to reflect changes is beyond my scope.
It may or absolutely may not work. Where as in such setup with SSL works most of the time and that is the reason you were able to use it earlier on.

Btw, your FQDN is your hostname (erp.example.com), not just subdomain (erp)

If it solves your issue, please accept my answer.

1 Like

Hi @yashodhan,

thanks for quick replay…
unfortunately no luck - still the same behavior
but thank you anyway :+1:

anyone any other ideas?

rgds

I fugured that new nginx versions dont catch all anymore
I think I ll have to pass the “default_server” but I´m struggling
as nginx still points to ./erp
which is not a subfolder of …/sites
It should point to erp.example.com when calling
https://erp

anyone who has more experience setting up nginx??

@spa
please mention the host name in the frappe-bench$ folder config/nginx.conf
-relaod the nginx
please check the port of nginx is running.

Thanks,
Sagar Shiragawakar
New Indictrans Technologies Pvt Ltd.

@spa
Run bellow commands:
bench config dns_multitenant off
bench setup nginx
y
sudo service nginx reload

this worked for me, hope it’s work for you also

1 Like

Hi @mayar

ja that works also - quick fix if you only run one instance but as I have 3 installations

one native
one for app dev
and one stable

I had to play about with @sagars solution and get deeper into nginx configuration took a bit but worked in the end

thanks to all

2 Likes