Mobile app version of vmapp.org
Login or Join
Sue5673885

: Soft 404 problem with nginx frontend to apache2 modperl backend Using nginx as a frontend to our modperl apache2 servers. We have a soft 404 problem at Google Search Console. The problem is

@Sue5673885

Posted in: #Apache #Nginx #Perl

Using nginx as a frontend to our modperl apache2 servers.

We have a soft 404 problem at Google Search Console.

The problem is that we have many pages expiring all the time, once they expire we add a noindex robots tag immediately, show a "no longer available" screen to the viewer but are unable to send a 404 header to Google as nginx sends the header and the header is a 200 as the page is served ok in its eyes.

How can I tell apache to notify nginx to send a 404 header?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sue5673885

1 Comments

Sorted by latest first Latest Oldest Best

 

@Angela700

Use error_page directive and add this code:

server {
...
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
add_header Cache-Control "no-cache" always;
}
}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme