nginx反向代理nodejs
来源:互联网 发布:淘宝机票代理加盟 编辑:程序博客网 时间:2024/05/15 23:51
nginx version: nginx/1.10.1
设置nginx node的反向代理,在/etc/nginx/conf.d/include/nginx.code.conf
然后在etc/nginx/nginx.conf里添加一句include /etc/nginx/conf.d/include/*;
nginx.code.conf内容:(include/nginx.code.conf为需要自己建立的文件)
upstream nodejs {
#只需要修改此处的3000端口,改为自己应用的端口
server 127.0.0.1:3000;
#server 127.0.0.1:3001;
keepalive 64;
}
server {
#80为nginx代理的端口,如果修改还需要改其他配置信息
listen 80;
server_name localhost;
access_log /var/log/nginx/test.log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Nginx-Proxy true;
proxy_set_header Connection "";
proxy_pass http://nodejs;
}
}
etc/nginx/nginx.conf内容:
- Nginx反向代理NodeJS
- nginx反向代理nodejs
- nginx反向代理部署nodejs
- Nginx作为Nodejs的反向代理
- Nodejs绑定域名与Nginx反向代理
- 【NodeJs】Linux安装NodeJs并配合Nginx实现反向代理
- NodeJS on Nginx: 使用nginx反向代理处理静态页面
- NodeJS on Nginx: 使用nginx反向代理处理静态页面
- Nginx反向代理Nodejs – log4js日志IP显示错误
- 使用nginx配置nodejs服务进行反向代理
- ubuntu_nginx+nodejs(反向代理)
- Nginx反向代理Nginx
- Nginx反向代理Nginx
- 【NodeJS】正向代理、反向代理、透明代理
- nginx 反向代理
- nginx 反向代理
- Nginx 反向代理https
- Nginx 反向代理设置
- 用js判断页面是否加载完成
- mysql 启动/停止命令
- jsp页面格式化数字或时间
- 浏览器兼容性问题
- java的性能优化
- nginx反向代理nodejs
- 鼠标不能在IE游览器上滑动的解决方法
- Material效果的下拉刷新MaterialRefreshLayout
- Manven+Eclipse+zookeeper搭建分布式架构
- HEVC/H.265入门(2)--编码框架与流程
- 海马玩模拟器端口
- HTML5 应用缓存,Application Cache
- 适配器模式
- ALERT! /dev/disk/by-uuid/xxxxxxxxx does not exist. Dropping to a shell!