总结一下nginx上经常使用的配置操做,做为记录吧css
一、nginx 配置静态文件如 js,csshtml
location ~* ^/wechat/report/.*\.(html|js|css|png|jpg|jpeg|gif|ico)$ { expires 1d; root /srv; }
经过配置上面,查看访问的日志,能够看到,若是访问的URL为 http://localhost:port/wechat/report/index.htmlnginx
访问日志为 /srv/wechat/report/index.html 能够发现 在uri前面添加了root 配置日志
二、http 跳转httpscode
。。。。htm