Is step 4 only required if you’re using openssl? Initially I was going on this assumption because it states to cd to /etc/nginx/ssl and I don’t see this directory.
But then when editing the hass file created in step 5 the line below made me question if I do in fact need to do step 4. Should i just comment this out if using letsencrypt?
# Ensure this line points to your dhparams file
ssl_dhparam /etc/nginx/ssl/dhparams.pem;
I’m using let’s encrypt and don’t have this line. But this is not a OpenSSL-config exclusive thing. I DO recommend actually including it. If you for what ever reason don’t want to do that you also have to uncomment a few oder lines of your SSL config from that tutorial. I only have those two lines in mine and it works:
The reason for me not having those is I did not know about that as I established my reverse proxy before I knew about that tutorial and haven’t found time yet to integrate them
Unable to start nginx. Not sure what I missed. It was running when i first installed it as I stopped it manually. Tried rebooting RPi, no luck.
pi@hassbian:~ $ sudo systemctl status nginx.service -l
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Wed 2017-03-15 13:10:51 EDT; 45s ago
Process: 706 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Mar 15 13:10:50 hassbian systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 15 13:10:51 hassbian nginx[706]: nginx: [emerg] "http" directive is not allowed here in /etc/nginx/sites-enabled/default:1
Mar 15 13:10:51 hassbian nginx[706]: nginx: configuration file /etc/nginx/nginx.conf test failed
Mar 15 13:10:51 hassbian systemd[1]: nginx.service: control process exited, code=exited status=1
Mar 15 13:10:51 hassbian systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Mar 15 13:10:51 hassbian systemd[1]: Unit nginx.service entered failed state.
pi@hassbian:~ $ sudo systemctl status nginx.service -l
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Wed 2017-03-15 13:22:46 EDT; 11s ago
Process: 1920 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Mar 15 13:22:46 hassbian nginx[1920]: nginx: [emerg] unknown directive “myserver.duckdns.org” in /etc/nginx/sites-enabled/default:4
Mar 15 13:22:46 hassbian nginx[1920]: nginx: configuration file /etc/nginx/nginx.conf test failed
Mar 15 13:22:46 hassbian systemd[1]: nginx.service: control process exited, code=exited status=1
Mar 15 13:22:46 hassbian systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Mar 15 13:22:46 hassbian systemd[1]: Unit nginx.service entered failed state.
No luck. Still failing to start. My hass file is basically a copy and paste from the tutorial. Edited with my duckdns info. The items I edited below.
server {
# Update this line to be your domain
myhostname.duckdns.org;
# These shouldn't need to be changed
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
return 301 https://$host$request_uri;
}
server {
# Update this line to be your domain
myhostname.duckdns.org;
ssl_certificate /etc/letsencrypt/live/myhostname.duckdns.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/myhostname.duckdns.org/privkey.pem;
It’ll run for quite a while, I can’t recall how long it took on my Raspberry Pi 3. Yes, you could cancel, but honestly I’d just let it continue to run.