Welcome! Log In Create A New Profile

Advanced

Re: rewrite server responses

Julien Vehent
October 02, 2010 06:22AM
On Sat, 2 Oct 2010 13:55:34 +0400, Igor Sysoev <igor@sysoev.ru> wrote:
> 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 <fqdn>: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]


HTTP/1.1 302 Moved Temporarily
Server: nginx/0.7.67
Date: Sat, 02 Oct 2010 10:14:30 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: http://example.net:5004/blog/admin/auth.php
----------------------------------------------------------

The conf:

-------------
server {
listen 127.0.0.1:5004;
server_name example.net;


access_log /var/log/nginx/example.net.access.log;
root /var/www;
index index.php index.html index.htm;
location /ressources {
autoindex on;
}
location /blog/admin {
port_in_redirect off;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/spawn-fcgi-php5.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
-------------



Julien

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

rewrite server responses

Julien Vehent October 02, 2010 05:56AM

Re: rewrite server responses

Igor Sysoev October 02, 2010 06:00AM

Re: rewrite server responses

Julien Vehent October 02, 2010 06:22AM

Re: rewrite server responses

Dayo October 04, 2010 12:20PM

Re: rewrite server responses

Julien Vehent October 04, 2010 03:42PM

Re: rewrite server responses

Maxim Dounin October 05, 2010 06:58AM

Re: rewrite server responses

Julien Vehent October 05, 2010 07:40AM

Re: rewrite server responses

Julien Vehent October 05, 2010 07:46AM

Re: rewrite server responses

Grzegorz Nosek October 05, 2010 08:04AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready