Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
371 views
in Technique[技术] by (71.8m points)

dns - 2 Homeservers 2 Domains possibel?

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...