k8s nginx.conf配置文件配置

  • 无状态nginx配置
  • nginx.conf覆盖容器配置
    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_read_timeout 6000;
    		       proxy_pass http://gatewayserver.rz-dt:30001/;
    		}
    		location /weixin/ {
    			proxy_pass http://ossaccessserver.rz-dt:30002/weixin/;
    		}
    		location /upload/ {
    			client_max_body_size 1024M;
    			client_body_buffer_size 1024M;
    			proxy_pass http://fileserver.rz-dt:30001/upload/;
    		}
    		location /events/ {
    			proxy_pass http://sseserver.rz-dt:30001/events/;
    		}
    		location /getEsignSignUrl/ {
    			proxy_pass http://fileserver.rz-dt:30001/getEsignSignUrl/;
    		}
    		location /public/ {
    			proxy_pass http://sseserver.rz-dt:30001/public/;
    		}
    		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 /getPdfP
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值