Ik ben al uren bezig met iets wat eigenlijk best simpel moet zijn.
Thuis heb ik een aantal Raspberry's die ik als webserver heb.
Als er een request binnen komt wordt al het verkeer op poort 80 naar een server gestuurd.
Bijvoorbeeld:
Wat zie ik nou over het hoofd dat alles dus naar domain.com wordt gestuurd?
de code op de eerste raspberry is:
Dit werkt gewoon, op de raspberry achter 192.168.1.200 komen de juiste requests binnen maar daar gaat het fout.
Alles wordt geredirected naar domain.com
De code achter 192.168.1.200
Thuis heb ik een aantal Raspberry's die ik als webserver heb.
Als er een request binnen komt wordt al het verkeer op poort 80 naar een server gestuurd.
Bijvoorbeeld:
- *.domain-a.com -> /var/www/apacheserver/....
- *.domain-b.com -> ProxyPass 192.168.1.200
- [list]
- www.domain-b.com -> /var/www/apacheserver/...
- sub.domain-b.com -> ProxyPass localhost:8080 -> tomcat
- [/list]
Wat zie ik nou over het hoofd dat alles dus naar domain.com wordt gestuurd?
de code op de eerste raspberry is:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| <VirtualHost *:80> ServerName domain-a.nl ServerAlias *.domain-a.nl ServerAlias domain-a.nl DocumentRoot /var/www/domain-a/ </VirtualHost> <VirtualHost *:80> ServerName sub.domain-b.nl ProxyPreserveHost On ProxyPass / http://192.168.1.200/ ProxyPassReverse / http://192.168.1.200/ </VirtualHost> <VirtualHost *:80> ServerName www.domain-b.nl ServerAlias domain-b.nl ProxyPreserveHost On ProxyPass / http://192.168.1.200/ ProxyPassReverse / http://192.168.1.200/ </VirtualHost> |
Dit werkt gewoon, op de raspberry achter 192.168.1.200 komen de juiste requests binnen maar daar gaat het fout.
Alles wordt geredirected naar domain.com
De code achter 192.168.1.200
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| <VirtualHost *:80> ProxyPreserveHost On ProxyRequests Off ServerName sub.domain-b.nl #/ Dit subdomein wil ik naar deze tomcatserver doorsturen en dat lukt niet omdat alles naar domain-b.com gaat /# ProxyPass / http://localhost:8080/ #### hier staat tomcat te luisteren ### ProxyPassReverse / http://localhost:8080/ </VirtualHost> <VirtualHost *:80> <Directory "/var/www/html"> AllowOverride All </Directory> ServerAdmin webmaster@localhost ServerName www.domain-b.nl ServerAlias domain-b.nl DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> |
[ Voor 1% gewijzigd door DixxyJS op 29-07-2017 17:08 . Reden: code tags ]