k8s nginx+ingress 配置

1 nginx> ingress 配置:

2 nginx >service 配置

3 nginx pod配置:

4 nginx.conf 配置文件:

    # 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 /rzwebgateway/ {
                        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/;
		}
}


       # 采集平台
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;
	}
}
相关推荐
颜淡慕潇2 小时前
【K8S问题系列 | 20 】K8S如何删除异常对象(Pod、Namespace、PV、PVC)
后端·云原生·容器·kubernetes
lmxnsI3 小时前
docker使用笔记
笔记·docker·容器
didiplus4 小时前
Kubernetes 镜像拉取策略全解析:如何根据需求选择最佳配置?
云原生·容器·kubernetes
玄德公笔记4 小时前
docker-compose搭建sfpt服务器
服务器·docker·容器·sftp·docker-compose
小钟不想敲代码6 小时前
Docker部署Sentinel
docker·容器·sentinel
上海运维Q先生6 小时前
面试题整理17----K8s中request和limit资源限制是如何实现的
服务器·云原生·kubernetes
胖毁青春,瘦解百病8 小时前
Docker镜像源设置不生效问题排查
docker·容器
CloudPilotAI8 小时前
15条 Karpenter 最佳实践,轻松掌握弹性伸缩
kubernetes·弹性伸缩·karpenter
会飞的土拨鼠呀8 小时前
Flannel是什么,如何安装Flannel
运维·云原生·kubernetes
ether-lin9 小时前
DevOps实战:用Kubernetes和Argo打造自动化CI/CD流程(1)
ci/cd·kubernetes·devops