nginx配置代理服務器,經過網閘之後的訪問方式

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    gzip on;
		gzip_min_length 1k;
		gzip_buffers 4 16k;
		#gzip_http_version 1.0;
		gzip_comp_level 6;
		gzip_types text/plain application/javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
		gzip_vary off;
		gzip_disable "MSIE [1-6]\.";
    server {
        listen       1188;
        server_name  localhost;
        location / {
			proxy_pass http://23.12.214.5:1188/;
			proxy_set_header X-Real-IP $remote_addr;  # 攜帶用戶ip
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 攜帶頭信息
        }
    }
    server {
        listen       1166;
        server_name  localhost;
        location / {
			proxy_pass http://23.12.214.5:1166/;
			proxy_set_header X-Real-IP $remote_addr;  # 攜帶用戶ip
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 攜帶頭信息
        }
    }
    server {
        listen       9064;
        server_name  localhost;
        location / {
			proxy_pass http://23.12.214.5:9064/;
			proxy_set_header X-Real-IP $remote_addr;  # 攜帶用戶ip
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 攜帶頭信息
        }
    }
 
      

 }


   

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章