0

For some reason, the rewrite to location /ancient/ isn't working.

If I switch out "/ancient/" for "http://google.com" (or any URL), the rewrite works. So I know my check for IE 6 is working.

Also, if I try to directly access /etc/static/ancient/ directly from the browser, I can. So I know the desired files are accessible.

location / {

    if ($http_user_agent ~ "MSIE 6.0") {
        rewrite ^ /ancient/;
        break;
    }
}

location /ancient/ {
    alias /Users/myusernametho/sterling/etc/static/ancient/;
}

I've run this on BrowserStack and with curl (UA spoofing) with the same results.

Am I misunderstanding something about how the rewrite directive works?

4

1 回答 1

0

在您的重写中需要可选的标志参数( break, last, )。redirect在你的情况下。您忘记在指令break的末尾写下,如下所示:rewrite

rewrite ^ /ancient/ break;

你不需要break在末尾if

于 2015-04-17T18:34:24.657 回答