Search code examples
nginxconfighttpserver

Excluding location path from file paths


In config file,

location /i/ {
    root /data/w3;
}

The /data/w3/i/top.gif file will be sent in response to the /i/top.gif request. How can I set it to ignore i in file paths? Indeed I need /i/top.gif to be mapped to /data/w3/top.gif.


Solution

  • location /i/ {
        alias /data/w3/;
    }