port_in_redirect

Maxim Dounin mdounin at mdounin.ru
Thu Jun 9 22:54:42 MSD 2011


Hello!

On Thu, Jun 09, 2011 at 08:23:33PM +0200, DUBOURG Kevin wrote:

> Hello,
> 
> Thanks for your return. I have this virtual Host :
> 
> server {
>         listen 8088;
>         server_name XXXX.XXXX.fr;
>         port_in_redirect off;
>         server_name_in_redirect off;
>         access_log /var/log/nginx/phpmyadmin.access_log;
>         error_log /var/log/nginx/phpmyadmin.error_log;
>         root /var/www;
> 
>         location /phpmyadmin {
>         alias   /var/www/phpmyadmin;
>         index  index.php index.html index.htm;
>         }
> 
>         index index.php;
>         location ~* \.php$ {
>                 fastcgi_pass 127.0.0.1:9000;
>                 fastcgi_index index.php;
>                 fastcgi_param SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
>                 include /etc/nginx/fastcgi_params;
>         }
> }
> 
> When i go to http://xxx.xxxx.fr/phpmyadmin/, i'm login and click "execute".
> 
> Next i redirect to http://xxx.xxxx.fr:8088/phpmyadmin/index.php
> (it's a problem, because it's behind a loadbalancer).
> 
> Normaly with port_in_redirect in my configuration, it should
> redirect to http://xxx.xxxx.fr/phpmyadmin/index.php.
> 
> No ?

The redirect in question is one done by your php script, not 
by nginx.  Directive port_in_redirect won't and shouldn't affect 
it.

There are two basic options to fix your redirects: either instruct 
script to do correct redirects, or fool it via setting appropriate 
fastcgi_param's (setting fastcgi_param SERVER_PORT 80; instead of 
real port should do the trick).

Maxim Dounin

> 
> 
> Le 09/06/2011 20:14, Maxim Dounin a écrit :
> >Hello!
> >
> >On Thu, Jun 09, 2011 at 08:05:05PM +0200, DUBOURG Kevin wrote:
> >
> >>Hello !
> >>
> >>I have Nginx 1.0.2 and port_in_redirect nginx doesn't work ...
> >>
> >>This paramater work for you in this version ?
> >Works ok here in 1.0.4 (too lazy to compile 1.0.2 just to test,
> >there were no changes in this area).  What do you mean by "doesn't
> >work"?
> >
> >Maxim Dounin
> >
> >_______________________________________________
> >nginx mailing list
> >nginx at nginx.org
> >http://nginx.org/mailman/listinfo/nginx
> >
> >
> 
> 
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list