Welcome! Log In Create A New Profile


CGI reply

Posted by UKenGB 
CGI reply
May 30, 2021 07:38AM
Does nginx pay any attention to http headers returned from a CGI program/script?

Specifically, I'd like the CGI to be able to generate appropriate http response headers, but it seems to me that nginx ignores these and just sends a 200 OK response when it actually finds the CGI file. I was hoping I could create a 301/2 redirect header to be sent back to the original requestor, however that instead just receives a 200 OK and nothing else.

Even if I cannot construct a redirect in this way, the CGI may not be able to create a response, depending on the query parameters it has been passed and so needs to be able to return an appropriate error that can be passed back to the original requestor.

Is there any way to tell nginx to simply pass on the http headers, as generated by the CGI? How else can the CGI respond that it cannot process the supplied query parameters?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 113
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready