Why is # rewritten to %23?

John Kennedy skebi69 at gmail.com
Wed Dec 7 10:15:03 UTC 2011


%23 is the ASCII Hexidecimal equivalent to #.
See http://www.ascii.cl/htmlcodes.htm for the full list of codes.
John

John Kennedy



On Wed, Dec 7, 2011 at 05:47, Ted Lemon <mellon at fugue.com> wrote:

> I've got a rewrite rule in my nginx config file to convert from an old URL
> to a new one, but the new URL has a hash string in it, and it doesn't seem
> to be possible to get nginx to rewrite that without encoding it.
>
> The relevant rewrite rule is this:
>
>                location /contact/dmes/term {
>                        rewrite "/contact/dmes/term/(.*)" "/#term=$1";
>                }
>
> This then goes through the following proxy:
>
>                location / {
>                        proxy_pass_header Server;
>                        proxy_set_header Host $http_host;
>                        proxy_redirect off;
>                        proxy_set_header X-Real-IP $remote_addr;
>                        proxy_set_header X-Scheme $scheme;
>                        proxy_pass http://tornado;
>                }
>
> The URL that the proxied http server gets is this (as it appears in the
> log):
>
> WARNING:root:404 GET /%23term=14/ (127.0.0.1) 0.30ms
>
> Is there some way to disable this behavior?   Have I violated some
> terrifying taboo?   Thanks for any advice/flames!
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20111207/55495e43/attachment.html>


More information about the nginx mailing list