comparison http_server_name.t @ 171:cfb8147f19a7

Tests: use (?P<name>...) to be compatible with old PCRE versions. Perl-style syntax (?<name>...) is only supported by PCRE 7.0+, while some OSes out there still use PCRE 6.6. Since there are no problems in nginx with (?P<name>...) syntax now, it should be safe to use Python syntax instead (at worst a bit more tests will be broken in case of regression).
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 30 Aug 2011 18:32:14 +0400
parents c0ae29632905
children a5f810eb87a2
comparison
equal deleted inserted replaced
170:c5696c97c735 171:cfb8147f19a7
75 } 75 }
76 } 76 }
77 77
78 server { 78 server {
79 listen 127.0.0.1:8080; 79 listen 127.0.0.1:8080;
80 server_name "~^(?<name>www\p{N}+)\.example\.com$"; 80 server_name "~^(?P<name>www\p{N}+)\.example\.com$";
81 81
82 location / { 82 location / {
83 add_header X-Server $server_name; 83 add_header X-Server $server_name;
84 add_header X-Match $name; 84 add_header X-Match $name;
85 return 204; 85 return 204;