# Port\_in\_redirect

**URL:** <https://www.ruby-forum.com/t/port-in-redirect/208079>\
**Category:** NGINX\
**Created:** [June 9, 2011, 8:05pm UTC](https://www.ruby-forum.com/t/port-in-redirect/208079 "2011-06-09T20:05:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 9, 2011, 8:05pm UTC](https://www.ruby-forum.com/t/port-in-redirect/208079/1 "2011-06-09T20:05:57Z")

</div>

Hello !

I have Nginx 1.0.2 and port\_in\_redirect nginx doesn’t work …

This paramater work for you in this version ?

Many thanks,

---

<div class="post-metadata">

**Author:** ![DUBOURG\_Kevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f6c823/32.png) [@DUBOURG\_Kevin](https://www.ruby-forum.com/u/DUBOURG_Kevin)\
**Post date:** [June 9, 2011, 8:15pm UTC](https://www.ruby-forum.com/t/port-in-redirect/208079/2 "2011-06-09T20:15:12Z")

</div>

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 D.

---

<div class="post-metadata">

**Author:** ![DUBOURG\_Kevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f6c823/32.png) [@DUBOURG\_Kevin](https://www.ruby-forum.com/u/DUBOURG_Kevin)\
**Post date:** [June 9, 2011, 8:23pm UTC](https://www.ruby-forum.com/t/port-in-redirect/208079/3 "2011-06-09T20:23:51Z")

</div>

Hello,

Thanks for your return. I have this virtual Host :

server {  
listen 8088;  
server\_name [XXXX.XXXX.fr](http://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/](http://xxx.xxxx.fr/phpmyadmin/), i’m login and click  
“execute”.

Next i redirect to [http://xxx.xxxx.fr:8088/phpmyadmin/index.php](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](http://xxx.xxxx.fr/phpmyadmin/index.php).

No ?

Le 09/06/2011 20:14, Maxim D. a crit :

---

<div class="post-metadata">

**Author:** ![DUBOURG\_Kevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f6c823/32.png) [@DUBOURG\_Kevin](https://www.ruby-forum.com/u/DUBOURG_Kevin)\
**Post date:** [June 9, 2011, 8:55pm UTC](https://www.ruby-forum.com/t/port-in-redirect/208079/4 "2011-06-09T20:55:25Z")

</div>

Hello!

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

> ```
> error_log /var/log/nginx/phpmyadmin.error_log;
> fastcgi_index index.php;
> 
> ```
> 
> Normaly with port\_in\_redirect in my configuration, it should  
> redirect to [http://xxx.xxxx.fr/phpmyadmin/index.php](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 D.

---

<div class="post-metadata">

**Author:** ![DUBOURG\_Kevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f6c823/32.png) [@DUBOURG\_Kevin](https://www.ruby-forum.com/u/DUBOURG_Kevin)\
**Post date:** [June 14, 2011, 5:58pm UTC](https://www.ruby-forum.com/t/port-in-redirect/208079/5 "2011-06-14T17:58:09Z")

</div>

It’s work !!

Thanks for your Help. I do that =\> [Config · phpmyadmin/phpmyadmin Wiki · GitHub](http://wiki.phpmyadmin.net/pma/Config)

A+

Le 14/06/2011 17:51, DUBOURG Kevin a écrit :

---

<div class="post-metadata">

**Author:** ![DUBOURG\_Kevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f6c823/32.png) [@DUBOURG\_Kevin](https://www.ruby-forum.com/u/DUBOURG_Kevin)\
**Post date:** [June 14, 2011, 5:51pm UTC](https://www.ruby-forum.com/t/port-in-redirect/208079/6 "2011-06-14T17:51:59Z")

</div>

Hello,

I try to change :

fastcgi\_param SERVER\_PORT 80;

But i still have the problem …

I don’t thinks phpmyadmin redirect on port 8088. For me it’s Nginx, but  
i don’t find a solution.

Le 09/06/2011 20:54, Maxim D. a écrit :
