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?