Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
372 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...