随笔 - 7  文章 - 0 评论 - 5 阅读 - 16822
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

一、去nginx官网下载nginx相应的版本

二、打开nginx下的conf目录下的nginx.conf文件,并备份此文件一份

三、把nginx.conf的内容修改如下:


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}

http {  
      include       mime.types;  
      default_type  application/octet-stream;  
      #开启gzip模块
      gzip on;
      sendfile        on; 
      keepalive_timeout  65;
   include proxy.conf;  #要配置的反向代理文件
 }

四、在通一目录下建立proxy.conf文件

proxy.conf文件内容配置如下:

upstream www.youhua.com{   
        server 11.28.85.159:8083 weight=1;    

        #server 192.168.10.2 weight=1; 
                                }
      server {    #Nginx代理服务器      
      listen       8089;        
        server_name  www.youhua.com;     
        location / {        
          root   html;        
          index  index.html index.htm;  
          proxy_pass  http://www.youhua.com;    
          proxy_redirect  default;     
                    }       
      error_page   500 502 503 504  /50x.html;  
     location = /50x.html
                 {          
   root   html;    
                 }  
        }
  

posted on   都市浪子  阅读(336)  评论(1编辑  收藏  举报
编辑推荐:
· 软件产品开发中常见的10个问题及处理方法
· .NET 原生驾驭 AI 新基建实战系列:向量数据库的应用与畅想
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· 一次Java后端服务间歇性响应慢的问题排查记录
· dotnet 源代码生成器分析器入门
阅读排行:
· ThreeJs-16智慧城市项目(重磅以及未来发展ai)
· .NET 原生驾驭 AI 新基建实战系列(一):向量数据库的应用与畅想
· 软件产品开发中常见的10个问题及处理方法
· Vite CVE-2025-30208 安全漏洞
· MQ 如何保证数据一致性?
点击右上角即可分享
微信分享提示