pound - Reverse-Proxy
Um verschiedene Server hinter einer einzigen IP-Adresse zu erreichen kann man ein Reverse Proxy Programm wie Pound installieren.
Diese Software kann so eingestellt werden, dass Anfragen von verschiedenen Subdomains an unterschiedliche interne IP-Adressen weitergeleitet werden.
In meinem Fall installiere ich Pound auf einem Raspberry Pi auf dem ein aktuelles Raspbian läuft.
Der Raspberry Pi hat eine Statische IP xxx.xxx.0.2/22.
Installation:
apt-get install pound
SSl-Key und Zertifikat generieren
cd /etc/ssl mkdir pound cd pound openssl req -x509 -newkey rsa:1024 -keyout pound.pem -out pound.pem -days 9999999 -nodes
Pound konfigurieren
(Alle eingehenden Verbindungen an xxx.xxx.0.2:80 werden weitergeleitet)
#RootJail "/chroot/pound" ## Logging: (goes to syslog by default) ## 0 no logging ## 1 normal ## 2 extended ## 3 Apache-style (common log format) LogLevel 1 ## check backend every X secs: Alive 30 ## use hardware-accelleration card supported by openssl(1): #SSLEngine "" # poundctl control socket Control "/var/run/pound/poundctl.socket" ################################################ ## listen, redirect and ... to: ## redirect all requests on port 80 ("ListenHTTP") to the local webservers: ListenHTTP Address xxx.xxx.0.2 Port 80 ## allow PUT and DELETE also (by default only GET, POST and HEAD)?: xHTTP 1 Service HeadRequire "Host:.router01.deinedomain.de.*" BackEnd Address xxx.xxx.10.1 Port 80 End End Service HeadRequire "Host:.nas01.deinedomain.de.*" BackEnd Address xxx.xxx.0.4 Port 80 End End End ListenHTTPS Address xxx.xxx.0.2 Port 443 Cert "/etc/ssl/pound/pound.pem" AddHeader "HTTPS: ON" Service HeadRequire "Host:.files.deinedomain.de.*" BackEnd Address xxx.xxx.0.5 Port 443 End End
In Raspbian den Daemon einschalten durch
Bearbeiten der Datei: /etc/default/pound
startup=1
Pound starten
service pound start