首页 > 其他 > 详细

nginx动静分离

时间:2019-02-19 11:27:24      阅读:186      评论:0      收藏:0      [点我收藏+]
nginx配置文件
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream static_pools { server 122.114.96.142:8080; } upstream dynamic_pools { server 122.114.96.143:8080; } server { listen 80; location / { root html; index index.html index.htm; proxy_pass http://dynamic_pools; } location ~ .*.(gif|jpg|jpeg|png|bmp|swf|css|js)$ { //如果请求包含这些后缀,请求被转发到静态池,否则转发到动态池 proxy_pass http://static_pools; } } }
./nginx -s reload 加载配置
访问测试。

nginx动静分离

原文:https://www.cnblogs.com/jiayannvwang/p/10399851.html

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