码迷,mamicode.com
首页 > 其他好文 > 详细

location总结

时间:2018-01-29 15:48:58      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:root   php   gif   pass   http   png   follow   server   hello   

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总结

标签:root   php   gif   pass   http   png   follow   server   hello   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!