return 404 from map module default value

Igor Sysoev igor at sysoev.ru
Fri Aug 5 15:43:59 UTC 2011


On Fri, Aug 05, 2011 at 10:46:26AM -0400, zflairz wrote:
> I think I need "location ~* ^/.+" instead of "location /" because I have
> this:
> 
>         location / {
>                 index index.html;
>         }
> 
> so www.example.com will read /index.html, while in the case of "location
> /", it can't find / in mapping, then return 404. Am I right?

    location / {
        try_files  $uri  $uri/  @redirect;
        index   index.html;
    }


-- 
Igor Sysoev



More information about the nginx mailing list