url rewriting - Rewrite Nginx with $1 argument -
i'm trying rewrite url one, can't use $1 correctly:
location ~ ^/announce { rewrite ^(.*)$1 http://exemple.com/$1/announce.php?ip=$remote_addr&$args; }
in fact http://jack.exemple.com:2052/anything/announce
should become https://exemple.com/anything/announce.php?ip=$remote_addr&
that's work without $1
, not args beetwin http://jack.exemple.com:2052/
, /announce
i think it's pretty simple, not common, , can't find syntax.
i believe simple removing "1" $ in reg-ex "^(.*)$1" per below ...
location ~ ^/announce { rewrite ^(.*)$ http://exemple.com/$1/announce.php?ip=$remote_addr&$args; }
Comments
Post a Comment