k8s nginx.conf 配置文件如下

k8s nginx 配置文件如下:

nginx.conf 文件:

events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/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  /var/log/nginx/access.log;
    error_log  /var/log/nginx/error.log;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;

	# C++网关
	server
	{
		listen 30001;
		add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
                add_header X-XSS-Protection "1; mode=block";
                add_header X-Frame-Options "SAMEORIGIN always";
                add_header X-Content-Type-Options "nosniff";
		# 转发websocket需要的设置
		proxy_set_header X-Real_IP $remote_addr;
		proxy_set_header Host $host;
		proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection 'upgrade';
		location / {
                       proxy_set_header Connection 'keep-alive';
			proxy_pass http://gatewayserver.rz-dt:30001/;
		}
                
                location /upload/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://fileserver.rz-dt:30001/upload/;
		}
                 location /clean_download/ {
			proxy_pass http://fileserver.rz-dt:30001/clean_download/;
		}
                 location /clean_download_data/ {
			proxy_pass http://fileserver.rz-dt:30001/clean_download_data/;
		}
                location /getOssSignUrl/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://fileserver.rz-dt:30001/getOssSignUrl/;
		}
                location /getStsToken/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://fileserver.rz-dt:30001/getStsToken/;
		}
                location /getPreviewUrl/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://fileserver.rz-dt:30001/getPreviewUrl/;
		}
                location /change_image_background_color/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://fileserver.rz-dt:30001/change_image_background_color/;
		}
                location /docx2pdf/ {
			client_max_body_size 50M;
			client_body_buffer_size 50M;
			proxy_pass http://fileserver.rz-dt:30001/docx2pdf/;
		}
		location /upload_esign/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://electronicpythonserver.rz-dt:30001/upload_esign;
		}
                location /elec_python/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://electronicpythonserver.rz-dt:30001/;
		}
		location /download/ {
			proxy_pass http://fileserver.rz-dt:30001/download/;
		}
		location /fdd_notify/ {
			proxy_pass http://electroniccbpythonserver.rz-dt:30001/;
		}
                location /hdwd_download/ {
                        client_max_body_size 1024M;
                        client_body_buffer_size 1024M;
			proxy_pass http://investorrelationpythonserver.rz-dt:30001/download_interqa;
		}

                # 通讯录
        location /address_book/ {
            client_max_body_size 1024M;
            client_body_buffer_size 1024M;
			proxy_pass http://addressbookpythonserver.rz-dt:30001/;
		}

		access_log /var/log/nginx/way.realize.cn.log;
	}
	
	
        # web端v1
	server
	{
		listen 30006;
		add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
                #add_header Content-Security-Policy "default-src 'self' http://test123.realize.cn; font-src 'self' data:; script-src unsafe-inline; script-src-elem unsafe-inline";
                add_header X-XSS-Protection "1; mode=block";
                add_header X-Frame-Options "SAMEORIGIN always";
                add_header X-Content-Type-Options "nosniff";

		# 转发websocket需要的设置
		proxy_set_header X-Real_IP $remote_addr;
		proxy_set_header Host $host;
		proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection 'upgrade';
		location / {
			proxy_pass http://frontdongmi-official-v1.rz-dt:30001/;
		}
                location /pdf_web/ {
			proxy_pass http://pdfwebserver.rz-dt:30001/pdf_web/;
		}
                location /weapp_esg/ {
			proxy_pass http://pdfwebserver.rz-dt:30001/weapp_esg/;
		}
                location /zhiku/ {
			proxy_pass http://frontdongmi-v1.rz-dt:30001/zhiku/;
		}
                location /managePlatForm/ {
			proxy_pass http://frontdongmi-manager.rz-dt:30001/managePlatForm/;
		}
                location /video/ {
			proxy_pass http://frontdongmi-video.rz-dt:30001/video/;
		}
                location /page/ {
			proxy_pass http://frontdongmi-page.rz-dt:30001/page/;
		}
                location /visualization/ {
			proxy_pass http://frontdongmi-visualization.rz-dt:30001/visualization/;
		}
                location /h5/ {
			proxy_pass http://frontdongmi-h5.rz-dt:30001/h5/;
		}
                location /h5_weApp/ {
			proxy_pass http://frontdongmi-h5-weapp.rz-dt:30001/h5_weApp/;
		}
                location /m/ {
			proxy_pass http://frontdongmi-h5.rz-dt:30001/m/;
		}
                location /marketData/ {
                        proxy_pass http://frontdongmi-marketdata.rz-dt:30001/marketData/;
                }
                location /weixin/ {
			proxy_pass http://ossaccessserver.rz-dt:30002/weixin/;
                }
                location /.well-known/ {
			proxy_pass http://ossaccessserver.rz-dt:30002/.well-known/;
                }
                location /getStsToken/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://fileserver.rz-dt:30001/getStsToken/;
                }
                location /rzgateway/ {
                        client_max_body_size 1024M;
                        client_body_buffer_size 1024M;
                        proxy_pass http://application-gateway.rz-dt:8080/;
		}
                location /rzwebgateway/ {
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
			add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';

			if ($request_method = 'OPTIONS') {
				return 200;
			}
                        client_max_body_size 1024M;
                        client_body_buffer_size 1024M;
                        proxy_pass http://realize-gateway.rz-dt:9300/;
		}
                location /gateway/ {
                       proxy_set_header Connection 'keep-alive';
			proxy_pass http://gatewayserver.rz-dt:30001/;
		}
		location /upload/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://fileserver.rz-dt:30001/upload/;
		}
                location /getPreviewUrl/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://fileserver.rz-dt:30001/getPreviewUrl/;
		}
		location /upload_esign/ {
			client_max_body_size 1024M;
			client_body_buffer_size 1024M;
			proxy_pass http://electronicpythonserver.rz-dt:30001/upload_esign;
		}
		location /download/ {
			proxy_pass http://fileserver.rz-dt:30001/download/;
		}
		location /fdd_notify/ {
			proxy_pass http://electroniccbpythonserver.rz-dt:30001/;
		}
		access_log /var/log/nginx/zhiku-v1.reize.cn.log;
	}
	
	

        # 采集平台
server
{
    listen 30004;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
    # 转发websocket需要的设置
    proxy_set_header X-Real_IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    location / {
        proxy_pass http://spiderflow.rz-dt:30001/;
    }
    access_log /var/log/nginx/spider.reize.cn.log;
}

    # 视频营销
	server
	{
		listen 30005;
		add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
		# 转发websocket需要的设置
		proxy_set_header X-Real_IP $remote_addr;
		proxy_set_header Host idtcdn.oss-cn-hangzhou.aliyuncs.com;
		proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection 'upgrade';
		location / {
			proxy_pass http://reize.oss-cn-hangzhou.aliyuncs.com/;
		}
		access_log /var/log/nginx/video.reize.cn.log;
	}
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值