Nginx
来源:互联网 发布:python批处理图片大小 编辑:程序博客网 时间:2024/06/03 23:39
Windows
反向代理配置
在conf/ngnix.conf的server节点下新建upstream server_lb节点,并配置服务器的地址。最终结构如下图所示
upstream test{ server 127.0.0.1:8080; } server { listen 80; server_name www.test.com; location / { proxy_pass http://test; index index.html index.htm; }
上面配置的意思是所有www.test.com这个路径的http访问请求都代理到test那里(因为proxy_pass http://test),由127.0.0.1:8080来提供服务。
- 配置动静分离
server { listen 80; server_name www.test.com; location / { root html; index index.html index.htm; } # 所有静态请求都由nginx处理,存放目录为html location ~ \.(gif|jpg|jpeg|png|bmp|swf)$ { root html; } # 所有动态请求都转发给tomcat处理 location ~ \.(jsp|do)$ { proxy_pass http://local_tomcat; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
- proxy_pass的路径写法
示例
更多
阅读全文
0 0
- nginx
- Nginx
- Nginx
- Nginx
- Nginx
- nginx
- nginx
- nginx
- nginx
- nginx
- nginx
- nginx
- nginx
- Nginx
- nginx
- nginx
- nginx
- nginx
- cookie和session的一些笔记
- 配置无线AP 采用POE供电模块怎么配置无线AP没有POE交换机
- 线程的概述
- 如何通过 JitPack 发布自己的开源项目
- 监控-Kafka Manager
- Nginx
- [Treap]poj2985 The k-th Largest Group
- 【POJ】2139
- $n$-Way Tie Gym
- 开发规范 项目 文件夹 目录 结构 分类
- Lazarus的INI文件处理机制
- 矩阵奇异值分解(SVD)
- C语言使用位移转换二进制
- hdu 1619