I'm trying to make custom 404 page.
Here is my 404.html:
<html>
<head>
<meta charset="UTF-8">
<title>Not Found</title>
</head>
<body>
<div style="...">
<div style="...">404</div>
<div style="...">Page not found</div>
<img src="404.gif" alt="not found" />
</div>
</body>
</html>
it works (almost), but I always get "Not found" error trying to load 404.gif
Here is my nginx config (want to make only localhost/main/data
and localhost/main/test
paths available):
http {
server {
listen 80;
server_name localhost;
error_page 404 /404.html;
location = /404.html {
root /var/www/error/;
}
location /404.gif {
root /var/www/error/;
}
location ~ ^/main/(data|test)$ {
}
When I'm trying to reach any page like http://localhost/main/error_page
server returns custom 404 page without gif and error GET http://localhost/main/404.gif 404 (Not Found)
.
How to load my gif, what path I need to provide in html or how to change config?