# Nginx always redirects the page - hopes somebody reads this

**URL:** <https://www.ruby-forum.com/t/nginx-always-redirects-the-page-hopes-somebody-reads-this/191375>\
**Category:** NGINX\
**Created:** [July 11, 2010, 5:27am UTC](https://www.ruby-forum.com/t/nginx-always-redirects-the-page-hopes-somebody-reads-this/191375 "2010-07-11T05:27:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvidinli](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/45deac/32.png) [@bvidinli](https://www.ruby-forum.com/u/bvidinli)\
**Post date:** [July 11, 2010, 5:27am UTC](https://www.ruby-forum.com/t/nginx-always-redirects-the-page-hopes-somebody-reads-this/191375/1 "2010-07-11T05:27:36Z")

</div>

Hi, I hope somebody reads this

i have a subdomain that is redirected to my server: [server2.10tl.net](http://server2.10tl.net)

when I try to access the page [http://server2.10tl.net/mybb/create](http://server2.10tl.net/mybb/create) in  
the browser,  
it always redirect me to [http://10tl.net/mybb/create](http://10tl.net/mybb/create) (which is  
located on another server… )

why this redirection happens?

I tried a few things before, about redirection, but currently, there  
isn’t any directive about redirection (rewrite directive) in any nginx  
configs.

here is my vhost nginx config:

server {  
listen 80 ;  
server\_name [10tl.net](http://10tl.net) \*.10tl.net;

access\_log /var/www/vhosts/bvidinli/10tl.net/logs/access\_log2 ;  
error\_log /var/www/vhosts/bvidinli/10tl.net/logs/error\_log2 ;  
access\_log /var/log/apache\_common\_access\_log;

location / {

root /var/www/vhosts/bvidinli/10tl.net/httpdocs;  
index index.html index.htm index.php;  
}

location ~ /.ht {  
deny all;  
}

}

it seems as if like, nginx remembers the old rewrite directive and  
sends me to that url.  
it is same when I try access [http://server2.10tl.net/mybb/xxx](http://server2.10tl.net/mybb/xxx) or any  
url that has mybb inside.  
really strange for me.  
i am new in nginx and want to use it.

i am almost sure that redirection occurs because of nginx, since the  
directory /var/www/vhosts/bvidinli/10tl.net/httpdocs does not contain  
any redirection code, only index.php that has not any redirection.

one more clue:  
the redirection occurs only I enter no php file at end of url.  
if I enter [http://server2.10tl.net/mybb/create/dene.php](http://server2.10tl.net/mybb/create/dene.php) for example (a  
file that has sample output), it shows it to me as expected…

the redirection occurs only when I try to access  
[http://server2.10tl.net/mybb/create](http://server2.10tl.net/mybb/create) without php filename at end.

---

<div class="post-metadata">

**Author:** ![bvidinli](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/45deac/32.png) [@bvidinli](https://www.ruby-forum.com/u/bvidinli)\
**Post date:** [July 11, 2010, 8:24am UTC](https://www.ruby-forum.com/t/nginx-always-redirects-the-page-hopes-somebody-reads-this/191375/2 "2010-07-11T08:24:19Z")

</div>

On Sun, Jul 11, 2010 at 7:25 AM, bvidinli [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi, I hope somebody reads this
> 
> here is my vhost nginx config:
> 
> server {  
> just add here:  
> server\_name\_in\_redirect off;

–  
Boris D..
