Adding 404 pages
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
#
|
||||
|
||||
@@ -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
|
||||
#
|
||||
|
||||
39
errors/404.html
Normal file
39
errors/404.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
|
||||
<link href="ngd-style.css" rel="stylesheet" type="text/css">
|
||||
<title>Error - 404</title>
|
||||
</head>
|
||||
<body class="status-page" id="app">
|
||||
<div class="interface">
|
||||
<div class="navbar-container">
|
||||
<div class="navbar">
|
||||
<div class="brand">
|
||||
<figure>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="status-page-panel">
|
||||
<img src="ngd-sad.svg">
|
||||
<h1>Error: 404</h1>
|
||||
<p>Looks like we can't find that page</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="site-footer">
|
||||
<section class="extra-pad">
|
||||
<figure class="brand">
|
||||
<a href="http://ngineered.co.uk/" title="visit ngineered">
|
||||
<img src="http://ngineered.co.uk/themes/default/img/brand-light.svg">
|
||||
</a>
|
||||
</figure>
|
||||
<nav class="social-links">
|
||||
<a href="https://github.com/ngineered" title="View our github profile"><i class="ion-social-github"></i>Github</a>
|
||||
<a href="https://twitter.com/ngineered" title="View our twitter profile"><i class="ion-social-twitter"></i>Twitter</a>
|
||||
</nav>
|
||||
</section>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
1
errors/sad.svg
Normal file
1
errors/sad.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="132" height="132" viewBox="0 0 132 132" xmlns="http://www.w3.org/2000/svg"><title>Artboard 2</title><g fill="none" fill-rule="evenodd"><path d="M65.695 121.985c-30.486 0-55.288-24.803-55.288-55.29 0-30.485 24.802-55.288 55.288-55.288 30.487 0 55.29 24.803 55.29 55.29 0 30.485-24.803 55.288-55.29 55.288" stroke="#000" stroke-width="8"/><path d="M96.373 96.286a3.622 3.622 0 0 0 2.35-4.552c-5.75-18.018-21.97-25.57-35.5-25.073-15.294.57-27.03 10.277-30.628 25.334a3.622 3.622 0 0 0 7.045 1.683c3.358-14.054 14.523-19.43 23.853-19.78 10.79-.392 23.735 5.64 28.33 20.04a3.623 3.623 0 0 0 4.55 2.35M42.96 38.466a9.256 9.256 0 1 0 0 18.51 9.256 9.256 0 0 0 0-18.51m54.727 9.254a9.256 9.256 0 1 1-18.51 0 9.256 9.256 0 0 1 18.51 0" fill="#000"/></g></svg>
|
||||
|
After Width: | Height: | Size: 762 B |
6027
errors/style.css
Normal file
6027
errors/style.css
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user