location總結

server {
listen 80;
server_name www.test-i.com;
root /data/test;
index index.php index.html index.htm;
charset utf-8;php

location / {
    return 599;
}

location = / {
    return 111;
}

location ~ \.php$ {
    return 600;
}

location /hello/ {
  return 598 "hello world\n";
}

location /index.html {
  return 597;
}

location /z {
  # show 403
  deny all;
}

location /yeqing {
   proxy_pass   http://www.baidu.com;
}

location ~* \.(gif|jpg|jpeg|png|bmp)$ {
    return 602;
}

location ~* \.(js|css|less|woff|eot|svg|ttf|ico|json|csv)?$ {
    index a.js;
    #return 603;
}

}css

參閱:http://www.nginx.cn/115.htmlhtml

相關文章
相關標籤/搜索