Welcome! Log In Create A New Profile

Advanced

Possible bug? Redirect 301 to 1st hostname in server_name list

Dale Gallagher
November 29, 2010 05:18AM
Hi there

We're running nginx 0.7.67 and PHP 5.2.14 for a virtual host, with the
following config. host1 and host2 currently point to another server
(DNS), so host3 is used for testing. When requesting host3/drupal
nginx sends http 301 and the browser is redirected to host1/drupal
(which is on another server). If I place host3 1st in the list, then
everything works fine? Is this an nginx bug, or a config issue? If the
latter, how should I configure nginx so that drupal behaves
identically for all server_name's?

server {
listen 80;
server_name host1 host2 host3;
root /srv/web/host1/public;
access_log /srv/web/host1/log/access.log combined;

location / {
index.html index.php;
}
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 break;
}
error_page 404 /index.php

location ~ \.php$ {
fastcgi_pass unix:/srv/web/host1/sock/php.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

Thanks
Dale

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

Possible bug? Redirect 301 to 1st hostname in server_name list

Dale Gallagher November 29, 2010 05:18AM

Re: Possible bug? Redirect 301 to 1st hostname in server_name list

Boris Dolgov November 29, 2010 06:20AM

Re: Possible bug? Redirect 301 to 1st hostname in server_name list

Dale Gallagher November 29, 2010 07:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 295
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready