Hello!
So my issue is that the 404 from astro is not served by Nginx with the following configuration:
location /my-thing {
proxy_pass http://127.0.0.1:4666/my-thing;
proxy_http_version 1.1;
proxy_pass_header Server;
error_page 404 @thing_404;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
location @thing_404 {
return 302 https://fullurltosomething/;
}
In the example above, https://fullurltosomething/ never fires off. I still get a 404 error, but even though I am running an astro preview on http://127.0.0.1:4666/my-thing with a 404.astro file, I don't get to see it. It works without Nginx (getting served the actual 404.astro file). Any ideas how to make this work? Thanks!
PS. I suspect it has to do with astro preview's behavior because the same pattern works for something else i.e nextjs.