diff --git a/50x.html b/50x.html new file mode 100644 index 00000000..7b057994 --- /dev/null +++ b/50x.html @@ -0,0 +1,16 @@ + + + +

Error!

+ +

nginx could not find WROLPi! Are your services running?

+ +

sudo systemctl status wrolpi-app

+

sudo systemctl status wrolpi-api

+ +

If either of those services are not running, start it:

+ +

sudo systemctl start wrolpi-app

+

sudo systemctl start wrolpi-api

+ + diff --git a/install.sh b/install.sh index c492ed58..6bbc58f4 100755 --- a/install.sh +++ b/install.sh @@ -89,8 +89,12 @@ sudo -u postgres psql -c '\l' | grep wrolpi || ( # Install the WROLPi nginx config over the default nginx config. cp /opt/wrolpi/nginx.conf /etc/nginx/nginx.conf +cp /opt/wrolpi/50x.html /var/www/50x.html /usr/sbin/nginx -s reload +# Create the media directory. This should be mounted by the maintainer. +[ -d /media/wrolpi ] || mkdir /media/wrolpi + # Create the WROLPi user grep wrolpi /etc/passwd || useradd -d /opt/wrolpi wrolpi -s "$(command -v bash)" chown -R wrolpi:wrolpi /opt/wrolpi @@ -121,6 +125,8 @@ echo " WROLPi has successfully been installed! +Mount your external hard drive to /media/wrolpi if you have one. + Start the WROLPi services using: # sudo systemctl start wrolpi.target diff --git a/nginx.conf b/nginx.conf index 62d6f5e7..c824520a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -12,9 +12,14 @@ http { charset utf-8; include mime.types; + error_page 502 /error/50x.html; + error_page 503 /error/50x.html; + error_page 504 /error/50x.html; + server { - location /favicon.ico { - alias /opt/wrolpi/icon.ico; + location ^~ /error/ { + internal; + alias /var/www/; } location /apple-touch-icon.png {