Hai, Thanks for your response ! $1 did not work for me : nginx: unknown "1" variable nginx: configuration file /etc/nginx/nginx.conf test failed For future reference, here is what i used : map $request_uri $path { ~^(?P<pathname>/[^/]+)/ $pathname; default /; } seems to work in all my cases. but, if you want to explain, not sure about what this do : (/by pixeye - Nginx Mailing List - English
Hello there, I'm trying to set a new variable based on another one. I've found this response which is kinda close to what i want to do : https://www.ruby-forum.com/topic/6876231#1176774 map $request_uri $last_path { ~/(?<pathname>[^/]+)/?$ $pathname; } Except, i want to get the first path level only (and not the file name) ! It seems to work fine even if the syntax seems nby pixeye - Nginx Mailing List - English