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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

android - IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling -