nginx配置
2016-04-19 15:56
204 查看
nginx 命令有:
nginx.exe -s stop|quit|reload|reopen
Windows下启动nginx用start nginx.exe。
nginx配置:
upstream 用作负债均衡
proxy_pass 用作反向代理,用法: proxy_pass http://host:port/uri/;
例如:将本地环境下的两个项目test1、test2分别映射到test1.com、test2.com,test1和test2都在同一个8080端口的tomcat下面。
View Code
相关资料:
1、Windows下Nginx的启动、停止等命令
2、Nginx 反向代理、负载均衡、页面缓存、URL重写及读写分离详解
3、http://tengine.taobao.org/book/
4、https://www.ttlsa.com/nginx/use-nginx-proxy/
5、http://tshare365.com/archives/1617.html
nginx.exe -s stop|quit|reload|reopen
Windows下启动nginx用start nginx.exe。
nginx配置:
upstream 用作负债均衡
proxy_pass 用作反向代理,用法: proxy_pass http://host:port/uri/;
例如:将本地环境下的两个项目test1、test2分别映射到test1.com、test2.com,test1和test2都在同一个8080端口的tomcat下面。
server { listen 80; server_name test1.com; access_log logs/test1.com_access.log main; location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE_ADDR $remote_addr; proxy_set_header HTTP_CLIENT_IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_body_buffer_size 128k; proxy_connect_timeout 30; proxy_send_timeout 30; proxy_read_timeout 30; proxy_pass http://localhost:8080/test1/; } } server { listen 80; server_name test2.com; access_log logs/test2.com_access.log main; location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE_ADDR $remote_addr; proxy_set_header HTTP_CLIENT_IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_body_buffer_size 128k; proxy_connect_timeout 30; proxy_send_timeout 30; proxy_read_timeout 30; proxy_pass http://localhost:8080/test2/; } }
View Code
相关资料:
1、Windows下Nginx的启动、停止等命令
2、Nginx 反向代理、负载均衡、页面缓存、URL重写及读写分离详解
3、http://tengine.taobao.org/book/
4、https://www.ttlsa.com/nginx/use-nginx-proxy/
5、http://tshare365.com/archives/1617.html
相关文章推荐
- CentOS6下基于Nginx搭建mp4/flv流媒体服务器(可随意拖动)并支持RTMP/HLS协议(含转码工具)
- 通过nginx日志统计独立ip的个数
- nginx支持pathinfo方法
- 关于nginx的内置变量
- Linux+Nginx+Mysql+PHP服务器运行环境安装
- nginx一些需要注意的细节
- nginx 优化(突破十万并发)
- nginx相关学习的博客
- 【转】Nginx服务器详细配置含注释
- 配置Nginx多核CPU,worker_cpu_affinity使用方法和范例
- CentOS 安装和启动nginx
- yaf框架官方手册nginx配置错误
- nginx下多项目跨域ajax实现
- Nginx动静分离知识及配置
- RHEL/CentOS and Debian/Ubuntu上使用Nginx安装odoo9
- studyphp环境软件Nginx隐藏index.php和Pathinfo模式配置例子
- Nginx根据不同浏览器语言配置页面跳转的方法
- studyphp环境软件Nginx隐藏index.php和Pathinfo模式配置例子
- nginx reload 命令报:nginx: [error] invalid PID number
- PPA方式升级Nginx