nginx 实现动静分离 |
您所在的位置:网站首页 › nginx动静分离原理 › nginx 实现动静分离 |
nginx 实现动静分离
时间:2019-11-24 07:39
作者:Mr.Pan
阅读数:491
增加两个location配置,一个www存放静态页面,一个images存放静态图片 worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name 192.168.31.127; location /www/{ root /usr/data/; } location /images/{ root /usr/data/; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }查看运行效果,除了www和images,站点其他的url正常访问tomcat的服务 [推荐] .NET Core 学习资料精选:入门 [推荐] 数据库常见死锁原因及处理 [推荐] C# 设置Excel数据自适应行高、列宽的2种情况 (转) [推荐] C++ vector 和set结合数字去重练习 [推荐] win7 .net core 部署 The library hostfxr.dll was found, but loading it from C:\\hostfxr.dll failed [推荐] JdbcTemplate多数据源使用 [推荐] 深入学习Redis(2):持久化 [推荐] asp.net core系列 67 Web压力测试工具WCAT [推荐] .Net Core 2.0 获取客户端IP地址 [推荐] 第七天 让你的container实现跨主机访问 [推荐] 8天玩转并行开发——第八天 用VS性能向导解剖你的程序 [推荐] nodejs app.use(express.static) 静态文件托管 (四) [推荐] C++ 稀疏表的练习 [推荐] C++ Lambda表达式练习 [推荐] asp.net core系列 33 EF查询数据 (2) [推荐] Spring Boot 2 (五):Docker Compose + Spring Boot + Nginx + Mysql 实践 [推荐] 试试发布 [推荐] C++中 *p++ 到底是 *(p++) 还是 (*p)++ 1. 猜想 [推荐] JavaWeb-Log4j: WARN No appenders could be found for logger [推荐] C++ 模板练习 评论列表注册用户登录后才能发表评论,请登录 或 注册,访问 博客首页。 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |