I have an URL like ^/d/something/(.*)$, what I want to do is rewrite it internally, with no permanent or temporary HTTP redirect, so that $_SERVER['REQUEST_URI'] will have just $1 and not the whole ^/d/something/(.*)$. Using nginx.
Here is what I tried:
location /d/something/ { rewrite "^/d/something/(.*)$" /$1 last; } location / { include php-fcgi.conf; try_files $uri $uri/ /index.php$args; } in the php-fcgi.conf there is fastcgi_param REQUEST_URI $request_uri; and $request_uri remains the same, so when I hit /d/something/something2 symfony reouter, which relies on $_SERVER['REQUEST_URI'] shows /d/something/something2 while I expect it to be just /something2. I assume that's because $request_uri is not changed.
If I replace it with fastcgi_param REQUEST_URI $uri; then $_SERVER['REQUEST_URI'] becomes / , no matter what I send in something2 part, it's always just /. Why is that happening and how can I internally rewrite it to /$1?
Thanks!
UPDATE: here are the contents of php-fcgi.conf:
location ~ \.php { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_read_timeout 60s; }
php-fcgi.confcontain?