Welcome! Log In Create A New Profile

Advanced

Re: Why doesn't this work?

June 24, 2009 11:12PM
On Wed, Jun 24, 2009 at 7:49 PM, Maxim Dounin <mdounin@mdounin.ru> wrote:

>    server {
>        listen 80;
>        server_name ~^(.*?)\.mike\.foo\.com$;
>
>        set $name "";
>        if ($host ~ ^(.*?)\.mike\.foo\.com$) {
>            set $name $1;
>        }
>
>        ...
>    }

This doesn't seem to work for me.

server {
listen 80;
index index.php index.html;
server_name ~^(.*?)\.%%USER%%\.foo\.com$;

set $name $1;
root /home/%%USER%%/web/$name;

# set $name "";
# if ($host ~^(.*?)\.%%USER%%\.foo\.com$) {
# set $name $1;
# }
location / { }
include /etc/nginx/defaults.conf;
include /etc/nginx/confs/development.conf;
include /etc/nginx/expires.conf;
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_pass 127.0.0.1:%%PORT%%;
}
try_files $uri $uri/ /controller.php?uri=$uri&$args;
}

Location isn't allowed inside of an "if"

$host isn't recognized: [emerg]: invalid condition "$host" in
/etc/nginx/nginx.conf

etc...
Subject Author Posted

Why doesn't this work?

mike June 24, 2009 07:03PM

Re: Why doesn't this work?

Maxim Dounin June 24, 2009 07:26PM

Re: Why doesn't this work?

mike June 24, 2009 07:41PM

Re: Why doesn't this work?

mike June 24, 2009 08:29PM

Re: Why doesn't this work?

Maxim Dounin June 24, 2009 10:49PM

Re: Why doesn't this work?

mike June 24, 2009 11:12PM

Re: Why doesn't this work?

Maxim Dounin June 24, 2009 11:51PM

Re: Why doesn't this work?

mike June 25, 2009 12:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 127
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