Virtual server on virtualmin keeps redirecting to wrong website

只愿长相守 提交于 2019-12-04 16:01:31

Mullazman is right (thanks!). I have just had this problem after enabling the SSL on the domain A. Then, all the domains in the same installation were pointing to A.

I fixed it by editing the file located in /etc/apache2/sites-enabled/A.conf and changing the first line:

Wrong line -> <VirtualHost A.B.C.D:80>

Correct line -> <VirtualHost *:80>

Had the same issue. For anyone interested it's because I had at the header of my sites-enables/aaa.com.conf which was picking up all requests and send them to the first host.

Change it to and it started directing traffic to the correct virtual hosts.

It was triggered when I enabled SSL on aaa.com, it for some reason re-wrote the config file to use IP based filtering not domain name

Try to delete browser cache with CTRL+F5, then try again. If that doesn't help, check virtualhost configuration files -maybe there lies the problem.

The solution I found

I had the same problem ...

And I ended up with a lot of doubts ... And I searched for a SOLUTION for this case, I hope to help ...

1 - Should the BIND have an external or internal IP in the domain? I use only one IP for all servers, and in BIND all domains are with external IP. (The question is whether it should be external or internal IP).

R = Yes, you must configure the internal IP in Virtualmin, prefer to edit the file. Only in localhost you should have 127.0.0.1

2 - Would NGINX have any configuration? How to remove IP and just put (listen *: 80) instead of (listen 288.218.198.981:80)

R = This configuration was changed but then I had problems with DNS and I returned to use the INTERNAL IP (not the localhost) ... Normally this IP starts as: 10.1xx.xx.xx

But which configuration would work in general?

Restart these steps ... If you still have an error ...

Back up ... And in Virtualmin settings ...

Edit Virtual Server >> Activate Features >> Uncheck NGINX, BIND, NGINX SSL. He will ask for confirmation and click to confirm.

After this process is completed, return to the same option and reschedule ... This will make it delete the old ones and put a new one. (This works great for those who changed hosting and has old settings).

If you are importing a backup. Do not select the DNS and NGINX option ... One tip is to create Virtual Server {your domain / site} First of all ...

And only then only import directories and databases ...

So you will not have problems with DNS and wrong redirects ...


Update

This also occurs when the SSL certificate is not issued correctly.

Folder permissions are incorrect. Chmod 0755 folders 0644 Files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!