nginx静态化文件转发规则配置
来源:互联网 发布:阿里纳斯数据 编辑:程序博客网 时间:2024/04/27 22:50
需要nginx判断是否有此文件,如果没有就转发给tomcat,另一个server是把非www请求用久转发到www域名上,保证站点域名权重集中
nginx.conf的配置如下:
server {<span style="white-space:pre"></span>listen 80;<span style="white-space:pre"></span>server_name localhost;<span style="white-space:pre"></span>charset utf-8;<span style="white-space:pre"></span>location / {<span style="white-space:pre"></span>root html;<span style="white-space:pre"></span>index index.html;<span style="white-space:pre"></span>try_files $uri $uri/ @tomcat;<span style="white-space:pre"></span>}<span style="white-space:pre"></span>location @tomcat{<span style="white-space:pre"></span>proxy_passhttp://127.0.0.1:8080;<span style="white-space:pre"></span>}}server {<span style="white-space:pre"></span>listen 80;<span style="white-space:pre"></span>server_name baobaopeiwan.com;<span style="white-space:pre"></span>rewrite ^(.*) http://www.baobaopeiwan.com$1 permanent;}
0 1
- nginx静态化文件转发规则配置
- nginx静态文件配置
- nginx转发规则
- nginx转发规则
- nginx配置location总结及rewrite规则写法(转发)
- 【Day27】什么是nginx,以及通过 nginx 实现静态文件转发、反向代理和负载均衡的配置
- Nginx配置静态文件服务
- Nginx访问静态文件配置
- Nginx的转发匹配规则
- Nginx转发路径拼接规则
- 跨网段windows文件共享-路由器的转发规则配置
- nginx伪静态化rewrite规则
- nginx伪静态规则
- Nginx转发代理配置
- nginx 配置端口转发
- nginx配置转发
- nginx TCP转发配置
- nginx转发websocket配置
- Codeforces Round #292 (Div. 1) C. Drazil and Park 线段树维护
- AspNetPager分页控件源代码(Version 4.2)
- Fragment生命周期详解
- WCF传输大数据的设置
- 那些大闸蟹git
- nginx静态化文件转发规则配置
- UILabel的使用方法
- PackageManagerService 分析及执行流程
- 存储过程分页
- android开发之dip、dp、sp、pt和px的区别以及屏幕密度略谈(外加屏幕适配)
- List和ArrayList的区别
- 原YUV格式的解析 Android NV21 视频采集
- UVALive - 3983 Robotruck DP
- MyEclipse 快捷键