Regex for rewrite of subdomains

Steve Holdoway steve at greengecko.co.nz
Thu Feb 14 22:51:12 UTC 2013


I'd take a look at using pattern matching in a map
( http://wiki.nginx.org/HttpMapModule ) and redirecting if the default
value isn't found? Maybe not the most effective, but simpler to
maintain...

Steve

On Thu, 2013-02-14 at 17:05 -0500, etrader wrote:
> I want to rewrite subdomains by adding a separate server for subdomains as
> 
> 
> server {
> server_name domain.com
> ...
> }
> server {
> server_name *.domain.com
> }
> 
> but how I can I ass a rewrite rule int the second server to process
> subdomain requests as
> 
> keyword.domain.com/query=some to
> domain.com/script.php?query=some&sub=keyword
> 
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,236231,236231#msg-236231
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

-- 
Steve Holdoway BSc(Hons) MIITP 
http://www.greengecko.co.nz
Skype: sholdowa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6189 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130215/3794fccd/attachment.bin>


More information about the nginx mailing list