i have a homeserver with nextcloud which is running fine.
i got a domain (domain.com) registered and my homeserver uses ddclient to update the dns settings of the domain.
now i am working on another project with a raspberry pie which also should have a domain.
i already changed the listening ports of the raspberry apache2 to e.g. 8090 and got the port forwarded correctly.
when i open domain.com:8090 it redirects me to my raspberry instead of my homeserver which is nice.
Now....How can i get domain2.com go to my raspberry? it always leads to my homeserver :(
Did i missed some settings?
Solved
<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
ProxyPreserveHost On
ProxyPass / http://192.168.2.108:80/
ProxyPassReverse / http://192.168.2.108:80/
<Location />
Order allow,deny
Allow from all
</Location>
RewriteEngine on
RewriteCond %{SERVER_NAME} =domain.com [OR]
RewriteCond %{SERVER_NAME} =www.domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…