diff --git a/resources/default-settings/nginx.default b/resources/default-settings/nginx.default index 139603c18..23d5525e5 100644 --- a/resources/default-settings/nginx.default +++ b/resources/default-settings/nginx.default @@ -9,12 +9,51 @@ server { server_name _; location / { + location = /index.html { + error_page 404 = @buildwebui; + log_not_found off; + } + location = / { + error_page 404 = @buildwebui; + log_not_found off; + } try_files $uri $uri/ =404; } - location /docs { - alias /home/pi/RPi-Jukebox-RFID/docs/sphinx/_build/html/; - index index.html index.htm; - } + location /docs { + root /home/pi/RPi-Jukebox-RFID/docs/sphinx/_build/html; + try_files $uri $uri/ =404; + location = /docs/index.html { + error_page 404 = @runsphinx; + log_not_found off; + } + location = /docs { + error_page 404 = @runsphinx; + log_not_found off; + } + location = /docs/ { + error_page 404 = @runsphinx; + log_not_found off; + } + + } + + location @runsphinx { + root /home/pi/RPi-Jukebox-RFID/resources/html; + try_files /runsphinx.html =404; + internal; + } + + location @buildwebui { + root /home/pi/RPi-Jukebox-RFID/resources/html; + try_files /runbuildui.html =404; + internal; + } + + error_page 404 = /404.html; + location /404.html { + root /home/pi/RPi-Jukebox-RFID/resources/html; + internal; + } } diff --git a/resources/html/404.html b/resources/html/404.html new file mode 100755 index 000000000..6b522326a --- /dev/null +++ b/resources/html/404.html @@ -0,0 +1,22 @@ + + + +Phoniebox: File not found -- 404 + + + +
+

Ups! Requested file not found.

+

Why not try again from the top-level of +

+
+ + diff --git a/resources/html/runbuildui.html b/resources/html/runbuildui.html new file mode 100755 index 000000000..01a24052b --- /dev/null +++ b/resources/html/runbuildui.html @@ -0,0 +1,24 @@ + + + +Phoniebox Web UI not found: please re-build Web UI + + + +
+

Ups! Looks like your Web UI has not been build!

+

No reason to panic. Please run through the following steps: +

+

In case of trouble when building the Web UI, consult the documentation! +

+ + diff --git a/resources/html/runsphinx.html b/resources/html/runsphinx.html new file mode 100755 index 000000000..a59cc2e3a --- /dev/null +++ b/resources/html/runsphinx.html @@ -0,0 +1,24 @@ + + + +Phoniebox documentation not found: please build documentation + + + +
+

Ups! Looks like your documentation has not been build!

+

No reason to panic. Please run through the following steps: +

+

Or check out the online documentation at Read The Docs. +

+ +