Inhaltsverzeichnis

NGINX

Idee, den FHEM aus der Ferne steuern zu können wie hier 1)

Quelle ua 2)

Schnellere, kleinere Alternative zu Apache

Reverse Proxy

Redirect (bzw. proxy), um eine andere Webseite aufzurufen.

sudo nano /etc/nginx/sites-enabled/default In 'Server'

        location ~/fhem(.*)$ {
                proxy_pass http://127.0.0.1:8083/fhem$1$is_args$args;
                proxy_buffering off;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
        }

SSL

sudo mkdir -p /etc/ssl/certs

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/openhab.key -out /etc/ssl/openhab.crt

In the NGINX configuration, place the following underneath your server_name variable:

	ssl_certificate                 /etc/ssl/openhab.crt;
	ssl_certificate_key             /etc/ssl/openhab.key;

Passwort

sudo htpasswd -c /etc/nginx/.htpasswd [mein-username]

Now the configuration file (/etc/nginx/sites-enabled/default) needs to be edited to use this password. Open the configuration file and add the following lines underneath the proxy_* settings:

	auth_basic                            "Username and Password Required";
	auth_basic_user_file                  /etc/nginx/.htpasswd;