diff --git a/Dockerfile b/Dockerfile index 0608488..f61e3e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -107,6 +107,7 @@ RUN chmod 755 /usr/bin/pull && chmod 755 /usr/bin/push && chmod 755 /usr/bin/let # copy in code ADD src/ /var/www/html/ +ADD errors/ /var/www/errors/ EXPOSE 443 80 diff --git a/conf/nginx-site-ssl.conf b/conf/nginx-site-ssl.conf index d2ef551..de8f50b 100644 --- a/conf/nginx-site-ssl.conf +++ b/conf/nginx-site-ssl.conf @@ -25,17 +25,24 @@ server { location / { # First attempt to serve request as file, then # as directory, then fall back to index.html - try_files $uri $uri/ /index.php?q=$uri&$args; + try_files $uri $uri/ =404; } - #error_page 404 /404.html; + error_page 404 /404.html; + location = /404.html { + root /var/www/errors; + internal; + } - # redirect server error pages to the static page /50x.html - # - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /var/www/html; - } + location ^~ /ngd-style.css { + alias /var/www/errors/style.css; + access_log off; + } + + location ^~ /ngd-sad.svg { + alias /var/www/errors/sad.svg; + access_log off; + } # pass the PHP scripts to FastCGI server listening on socket # diff --git a/conf/nginx-site.conf b/conf/nginx-site.conf index bd2d64d..8b87c11 100644 --- a/conf/nginx-site.conf +++ b/conf/nginx-site.conf @@ -19,17 +19,24 @@ server { location / { # First attempt to serve request as file, then # as directory, then fall back to index.html - try_files $uri $uri/ /index.php?q=$uri&$args; + try_files $uri $uri/ =404; } - #error_page 404 /404.html; + error_page 404 /404.html; + location = /404.html { + root /var/www/errors; + internal; + } - # redirect server error pages to the static page /50x.html - # - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /var/www/html; - } + location ^~ /ngd-style.css { + alias /var/www/errors/style.css; + access_log off; + } + + location ^~ /ngd-sad.svg { + alias /var/www/errors/sad.svg; + access_log off; + } # pass the PHP scripts to FastCGI server listening on socket # diff --git a/errors/404.html b/errors/404.html new file mode 100644 index 0000000..1c3db7a --- /dev/null +++ b/errors/404.html @@ -0,0 +1,39 @@ + +
+ + + + +Looks like we can't find that page
+