Reputation: 59
My server uses a custom 404 page. Is't possible to get 404 server response on a direct request of 404 page? Now: URL: http://mydomain.xxx/404.php HTTP/1.1 200 OK Server: nginx
Upvotes: 5
Views: 10239
Reputation: 144
Serve /404.html content preserving original URL (404 status code).
server {
error_page 404 /404.html;
location = /404.html {
internal;
}
location / {
try_files $uri $uri/index.html $uri.html;
}
}
Upvotes: 0