Eli the Bearded
2018-08-14 18:45:23 UTC
I've done most of work with websevers using Apache. I'm trying to learn
the ways of Nginx for comparison. The pieces certainly fit together
differently with Nginx.
Here's a rough overview of what I have:
* main page of the site is a CGI using fastcgi
* this page mostly just issues redirects (302)
for the purposes of discussion, the redirect issued can be
considered random and constantly different (hence need for CGI)
(in actuality, it's deterministic)
* when someone requests a file besides the main page, if it
exists, I want people to reach it
* when someone requests a file that is a 404, I want the main
page CGI to run, so I added to the conf:
error_page 404 /index.cgi;
That all works. But the main page issues a "Status: 302" and a
"Location:" header, yet clients requesting a bad URL never see
a "HTTP/1.1 302 Found" response, instead they get a "HTTP/1.1 404
Not Found" which includes a "Location" header.
So is this something I fix in Nginx? Fastcgi? My CGI script? What's the
trick for converting the 404 to a new status?
Elijah
------
not sure where to begin searching for that
the ways of Nginx for comparison. The pieces certainly fit together
differently with Nginx.
Here's a rough overview of what I have:
* main page of the site is a CGI using fastcgi
* this page mostly just issues redirects (302)
for the purposes of discussion, the redirect issued can be
considered random and constantly different (hence need for CGI)
(in actuality, it's deterministic)
* when someone requests a file besides the main page, if it
exists, I want people to reach it
* when someone requests a file that is a 404, I want the main
page CGI to run, so I added to the conf:
error_page 404 /index.cgi;
That all works. But the main page issues a "Status: 302" and a
"Location:" header, yet clients requesting a bad URL never see
a "HTTP/1.1 302 Found" response, instead they get a "HTTP/1.1 404
Not Found" which includes a "Location" header.
So is this something I fix in Nginx? Fastcgi? My CGI script? What's the
trick for converting the 404 to a new status?
Elijah
------
not sure where to begin searching for that