开发者

how to excluded directory from nginx conf?

in nginx conf file,i use:

location ~ \.jsp {
    proxy_pa开发者_开发问答ss   http://127.0.0.1:86;
}

to parse my jsp file, now,i want excluded directory /upload/

this directory is user upload file directory ,don't need parse JSP file.(http://example.com/upload/)

how to change my location ~ \.jsp { ?

i need parse JSP *.jsp but excluded /upload/ and it's subdirectory.

thanks all :)


Here is a list of Nginx Core Directives:
http://wiki.nginx.org/NginxHttpCoreModule

By skimming through these I can see there's probably more than one way to achieve this. I can't test it, but here's something that may work:

error_page 403 /forbidden.html;
location ^~ /upload/ {
    deny all;
}

However, I would advise against this; your upload directory should never sit inside your web root. You should simply move the folder to achieve what you're asking.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜