Prefixing URL's

António P. P. Almeida appa at perusio.net
Tue Dec 28 14:08:19 MSK 2010


On 28 Dez 2010 05h12 WET, david at styleflare.com wrote:

> I have an app that uses relative URLs
>
> ie: /media/assets/css/style.css
>
> in my server config I have
>
> location /app {
>
> #config stuff here.
> }
>
> When I go to "/app" from a browser the urls are not prefixed with
> "/app" they stay the same ie: "/media/assets/css/style.css"
>
> But because I mounted the "/app" rather than the root "/" the urls
> are no longer valid.
>
> "/media/assets/css/style.css" should be
> "/app/media/assets/css/style.css"
>
> What options are available to fix this?

Try this: http://wiki.nginx.org/NginxHttpCoreModule#alias

--- appa




More information about the nginx mailing list