I have a nginx server that runs on 127.0.0.1:5004 (behind a load
balancer) and I’m having difficulties with HTTP responses.
It seems that the application (in PHP5, Dotclear) sends a 302 when I try
to connect to the admin panel, and this 302 redirects to :5004.
I there any way to rewrite that response in nginx ?
On Sat, Oct 02, 2010 at 11:49:50AM +0200, Julien Vehent wrote:
Hello list,
I have a nginx server that runs on 127.0.0.1:5004 (behind a load balancer) and I’m having difficulties with HTTP responses.
It seems that the application (in PHP5, Dotclear) sends a 302 when I try to connect to the admin panel, and this 302 redirects to :5004.
I there any way to rewrite that response in nginx ?
On Sat, Oct 02, 2010 at 11:49:50AM +0200, Julien Vehent wrote:
Hello list,
I have a nginx server that runs on 127.0.0.1:5004 (behind a load balancer) and I’m having difficulties with HTTP responses.
It seems that the application (in PHP5, Dotclear) sends a 302 when I try to connect to the admin panel, and this 302 redirects to :5004.
I there any way to rewrite that response in nginx ?
port_in_redirect off;
I just put that in the location section, put it doesn’t seem to take
effect.
GET /blog/admin/ HTTP/1.1
Host: example.net
[snip]
Could it be cached somewhere ?
I have haproxy as a frontend, but it really only does HTTP requests/responses balancing.
As long as you use fastcgi and your fastcgi application
returns wrong redirect - you should convince it to return correct
one by providing appropriate fastcgi_param’s.
Changing fastcgi_param SERVER_PORT to 80 should be enough as far
as I understand your case.
Rewriting of ‘Location’ header returned by backend only available
for proxy (see proxy_redirect directive), where it’s not possible
to control backend’s idea about correct server address.
On Tue, 5 Oct 2010 14:55:22 +0400, Maxim D. [email protected]
wrote:
for proxy (see proxy_redirect directive), where it’s not possible
to control backend’s idea about correct server address.
Maxim D.
Got it ! Indeed, it was a FASTCGI environment variable. but not that
one.
I had
PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
And by commenting it out, I don’t have this redirect problem anymore.
That makes me think: where can I find detailled information about
FASTCGI environment variables and their meanings ? Some, like
SERVER_PORT are easy, but what about REMOTE_PORT for example ?
On Tue, Oct 05, 2010 at 01:37:52PM +0200, Julien Vehent wrote:
That makes me think: where can I find detailled information about FASTCGI environment variables and their meanings ? Some, like SERVER_PORT are easy, but what about REMOTE_PORT for example ?