nginx对后端的目录进行反向代理
admin
2023-03-24 20:21:26
0

nginx主配置文件

worker_processes 1;

error_log  /home/data/logs/nginx/error.log;
#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

worker_rlimit_nofile 65535;

events {
    use epoll;
    worker_connections  65535;
}


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

    log_format  main  '$remote_addr - $remote_user [$time_local] "$http_host" "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" $http_x_forwarded_for ' 
                      '"$upstream_addr" "$upstream_status" "$upstream_response_time" "$request_time"';

    #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;
    access_log  /home/data/logs/nginx/access.log main;
    server_tokens off;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
	
	#--------------h2----------------
    upstream  plone {  
	   server 172.16.1.24:8080;    #重点
     }  

	
    #gzip  on;

    server_name_in_redirect off; 

    include vhosts/*.conf; #重点
   


}

nginx  vhosts里面的配置文件



[root@plone vhosts]# cat  plone.conf 

    server {
        listen       80;
        server_name  plone.sense.com.cn;
        access_log  /home/data/logs/nginx/plone_access.log main;
#        rewrite ^(.*)$  https://$host$1 permanent;
        location / {
                 proxy_set_header X-real-ip $remote_addr;
                 proxy_set_header Host $http_host;
                 proxy_set_header X-Forwarded-Scheme  $scheme;
                 proxy_pass   #重点 
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

}




#    server {
#        listen       443 ssl;
#        server_name  console.senseyun.com;
#	    access_log  /home/data/logs/nginx/ssl.console_senseyun.log main;
#		
#        ssl_certificate /opt/CA/senseyun.com_bundle.crt;
#        ssl_certificate_key /opt/CA/senseyun.com.key;
#
#
#       location ~^/ {
#                proxy_set_header X-real-ip $remote_addr;
#                 proxy_set_header Host $http_host;
#                proxy_set_header X-Forwarded-Scheme  $scheme;
#                proxy_pass http://console;
#       }
#
#        error_page   500 502 503 504  /50x.html;
#        location = /50x.html {
#            root   html;
#        }
#    }


相关内容

热门资讯

玩家最新攻略“拱趴游戏有挂吗?... 玩家最新攻略“拱趴游戏有挂吗?”(原来真的有挂)您好,拱趴游戏这个游戏其实有挂的,确实是有挂的,需要...
【第一资讯】“白金岛红拐弯开挂... 【第一资讯】“白金岛红拐弯开挂神器?”(详细开挂教程)您好,白金岛红拐弯这个游戏其实有挂的,确实是有...
终于懂了“新皇豪拼三张开挂器?... 有 亲,根据资深记者爆料新皇豪拼三张是可以开挂的,确实有挂(咨询软件无需...
【今日要闻】“大宝麻将是不是有... 有 亲,根据资深记者爆料大宝麻将是可以开挂的,确实有挂(咨询软件无需打开...
玩家分享攻略“七彩丹霞究竟有挂... 有 亲,根据资深记者爆料七彩丹霞是可以开挂的,确实有挂(咨询软件无需打开...
终于懂了“樱花牛牛辅助器?”(... 有 亲,根据资深记者爆料樱花牛牛是可以开挂的,确实有挂(咨询软件无需打开...
我来教教您“新版悟空开挂神器?... 我来教教您“新版悟空开挂神器?”(透视曝光猫腻)您好,新版悟空这个游戏其实有挂的,确实是有挂的,需要...
玩家最新攻略“熊猫麻将是不是有... 您好:熊猫麻将这款游戏可以开挂,确实是有挂的,需要了解加客服微信【4282891】很多玩家在这款游戏...
【第一财经】“数独大赛怎么装挂... 家人们!今天小编来为大家解答数独大赛透视挂怎么安装这个问题咨询软件客服徽9784099的挂在哪里买很...
今日重大发现“家乡亲友是不是有... 您好:家乡亲友这款游戏可以开挂,确实是有挂的,需要了解加客服微信【4282891】很多玩家在这款游戏...