Eugeny / ajenti-v

Virtual Hosting addon for Ajenti
ajenti.org/#product-ajenti-v
MIT License
224 stars 80 forks source link

I set up 2 domains in different folder but both is showing same site #248

Closed saadamin closed 7 years ago

saadamin commented 7 years ago

site 1 https://saadamin.com site 2 https://pms.saadamin.info

when I browse https://saadamin.com its redirected to https://pms.saadamin.info

https://saadamin.info conf file is https://is.gd/97wiFv 2016-12-15_03-41-05

and https://pms.saadamin.info conf file is https://is.gd/9sMC3a 2016-12-15_03-42-57

but if I disable https://pms.saadamin.info from like this https://is.gd/mF7M4j , I can see https://www.saadamin.com contents.

another important matter is https://ssr.saadamin.com is running fine.

here is my websites https://is.gd/C5sOjf

noogen commented 7 years ago

This is an nginx config issue and not Ajenti (not directly related anyhow ;) http://nginx.org/en/docs/http/server_names.html and also http://nginx.org/en/docs/http/request_processing.html

The fix is to change this line: server_name ssadamin.com -> to include www -> server_name ssadamin.com www.ssadamin.com

Explaination tldr;

Let assume/try to guess your configuration flow: ls /etc/nginx/conf.d pms.conf ssadmin.comf ssra.conf

Base on that alphanumeric display order, pms.conf would be your default_server. When the user hit http://ssadamin.com, Wordpress redirect to http://www.ssadmin.com. Since there is no server matching the definition www.ssadmin.com, it serve up your default server which is pms.conf in this case.

saadamin commented 7 years ago

I know its nginx issue , but nginx entries automatically generated by ajenti so its related . what I have done now is https://is.gd/juR7kS , so now its look like https://is.gd/iHKeBU , now I can visit saadamin.com , thanks a lot man , you are awesome.