Rewrite to

Ezra Zygmuntowicz ez at
Thu Nov 8 02:06:16 MSK 2007

Hi there-

	I'm trying to sort out a problem a client is having with a googlemap  
api key. I need to rewrite any requests that end in a . to the same  
request with no .


incoming request to  needs to be rewritten to  with no trailing dot , but retaining any uri so  ->

Any ideas on how to accomplish this? I tried something like this:

if ( $host ~* (.*?\.?foo\.com)\.)$ {
    set $domainwithoutdot $1;
     rewrite ^(.*)$ http://$domainwithoutdot$1 permanent;



Ezra Zygmuntowicz
Founder & Ruby Hacker
ezra at

More information about the nginx mailing list