首页 > 其他 > 详细

location总结

时间:2018-01-29 15:29:16      阅读:205      评论:0      收藏:0      [点我收藏+]
server {
listen 80;
server_name www.test-i.com;
root /data/test;
index index.php index.html index.htm;
charset utf-8;

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;
}

}

参阅:http://www.nginx.cn/115.html

location总结

原文:http://blog.51cto.com/yeqing/2066302

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!