Nginx 反向代理cdh

该博客主要介绍了Nginx的配置文件`nginx.conf`的基本设置,包括开启GZIP压缩、设置客户端最大上传大小和代理服务器的超时时间。特别是针对反向代理的配置,将请求代理到`192.168.1.73:7180`,并设置了相关超时和头部信息转发选项。这些设置对于优化Web服务器性能和提供稳定的服务至关重要。
摘要由CSDN通过智能技术生成

1.配置地址 nginx /conf/nginx.con


ttp {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;



#    sendfile on;
#    keepalive_timeout 65;

#  基本的设置 需要添加的
    gzip  on;
    client_max_body_size 50m;
    client_body_buffer_size 256k;
    client_header_timeout 3m;
    client_body_timeout 3m;
    send_timeout 3m;
    proxy_connect_timeout 300s;
    proxy_read_timeout 300s;
    proxy_send_timeout 300s;
    proxy_buffer_size 64k;
    proxy_buffers 4 32k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;
    proxy_ignore_client_abort on;



    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }



 # 配置反向代理  
 server{
                listen  10881;
                server_name  192.168.3.68;
                index  index.php index.html index.htm;
          location / {
                     proxy_pass  http://192.168.1.73:7180;

                      proxy_read_timeout 300;
                      proxy_connect_timeout 300;
                      proxy_set_header   X-Forwarded-Proto $scheme;
                      proxy_set_header   Host              $http_host;
                      proxy_set_header   X-Real-IP         $remote_addr;

                }








在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值