Welcome! Log In Create A New Profile

Advanced

Странное поведение при регулярных выражениях в server_name

Anton Bessonov
June 15, 2010 06:58PM
Всё идёт, а вот тут хоть тресни:

nginx_l1.conf


server {
listen 80;
#http://www.ruby-forum.com/topic/189724
server_name ~^(.*)\.beta\.site\.de$
~^www\.(.*)\.beta\.site\.de$;
set $subdomain $1;
#server_name ~^(www\.)?(?P<subdomain>.+)\.beta\.site\.de$;

location ~* ^.+.(html|gif|jpg|png|css|zip|rar|exe|com|txt)$ {
#root /home/site.de/subs/$subdomain;
#expires 30d;
proxy_buffering off;
proxy_pass http://127.0.0.1:1361;
}

location ~ {
fastcgi_cache off;
fastcgi_pass 127.0.0.1:1362;
fastcgi_index index.php;

include /usr/local/nginx/fastcgi.conf;
fastcgi_param DOCUMENT_ROOT /home/site.de/;
fastcgi_param SCRIPT_FILENAME
/home/site.de/subs/$subdomain$fastcgi_script_name;
}

}



nginx_l2.conf:
server {
listen 127.0.0.1:1361;

#server_name ~^(www\.)?(?P<subdomain>.+)\.beta\.site\.de$;
server_name ~^(.*)\.beta\.site\.de$ ~^www\.(.*)\.beta\.site\.de$;
set $subdomain $1;

location / {
root /home/site.de/subs/$subdomain;
access_log off;
#expires 30d;
}

}

значит fcgi и подобные конфиги работают. А тут полтергейст...

2010/06/15 22:53:40 [error] 25624#0: *293364 open()
"/home/site.de/subs//test.css" failed (2: No such file or directory),
client: 127.0.0.1, server: ~^(.*)\.beta\.site\.de$, request: "GET
/test.css HTTP/1.0", host: "127.0.0.1:1361"

то есть $subdomain пропущен...

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

Странное поведение при регулярных выражениях в server_name

Anton Bessonov June 15, 2010 06:58PM

Re: Странное поведение при регулярных выражениях в server_name

Maxim Dounin June 15, 2010 07:18PM

Re: Странное поведение при регулярных выражениях в server_name

Anton Bessonov June 16, 2010 10:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 166
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready