Sunday, 25 August 2013

Nginx alias redirection error

Nginx alias redirection error

For one of my projects, I would like to setup a static domain to improve
speed. I am faced with a small problem.
I would like to redirect URL like this :
http://mydomain.com/[URL]/img/toto.jpg
to
/path/to/my/project/[URL]/assets/img/toto.jpg
i tried this :
location ~ ^/([^/]+)/([^/?]+)$
{
alias /path/to/my/project/$1/assets/$2;
}
but it does not work.
Where is my pb ??
thank you very much

No comments:

Post a Comment