nginux做反向代理配置文件
2024-08-22 00:25:02
做反向代理的配置文件最好单独创建一个文件,然后在主配置文件中使用 include nginx-test.config; 这样的方式来导入。
配置代码如下:
- ## Basic reverse proxy server ##
- ## Apache backend for www.baidu.com ##
- upstream henushang {
- server www.baidu.com; # 或者ip:port这样形式也是可以的
- }
- ## Start www.baidu.com ##
- server {
- listen 80;
- server_name www.henushang.cn;#监听的域名
- access_log logs/henushang.access.log;
- error_log logs/henushang.error.log;
- root html;
- index index.html index.htm index.php;
- ## send request back to apache ##
- location / {
- proxy_pass http://henushang;#与上面的upstream名字相对应
- #Proxy Settings
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
- proxy_max_temp_file_size 0;
- proxy_connect_timeout 90;
- proxy_send_timeout 90;
- proxy_read_timeout 90;
- proxy_buffer_size 4k;
- proxy_buffers 4 32k;
- proxy_busy_buffers_size 64k;
- proxy_temp_file_write_size 64k;
- }
- }
最新文章
- POJ 1163 The Triangle(简单动态规划)
- Nginx 遇到的问题
- 使用BootStrap制作用户登录UI
- 在mac上安装pydev for eclipse时,在eclipse的Preferences中无法显示出来的解决方法
- Load Balancing 折半枚举大法好啊
- mac终端命令简介
- java多态 -- 猫狗案列
- SpringMVC10数据验证
- (转)使用DataTime这个类来获取当前的时间
- Caused by: java.lang.ClassNotFoundException: javax.transaction.TransactionManager
- Linux服务器SSH无法通过DSA证书登录的解决方法
- Linux 文件及目录管理命令基础
- 使用idea对spring boot项目打jar和war包[文件]
- [hdu P4334] Trouble
- [cloud][sdn] network namespace
- manifest.xml微擎系统模块的安装文件内容
- bzoj2342: [Shoi2011]双倍回文 pam
- [UE4]把枪打飞addImpulse
- nodeclub
- 【转】浅谈React、Flux 与 Redux
热门文章
- 基于AngularJS/Ionic框架开发的性能优化
- META 标签的使用
- Qt绘制异形窗体
- Linux RedHat无法安装软件问题(No package gcc available. Nothing to do)
- Java中的队列:java.util.Queue接口
- StringBuilder的Append()方法会比+=效率高
- MYSQL数据库主主同步实战
- $.ligerDialog 操作
- 微信支付配置信息,JSAPI接口,H5调用微信js接口支付,微信公众号支付
- EXTJS 资料 Ext.Ajax.request 获取返回数据