产品经理兼职做网站报酬,wordpress 主题 自定义,湖北省建设厅网站资质,建设网站定位分析统一nginx接入配置指南
Nginx配置规范
1:不带微服务编码上下文至后端,以metadata-ui为例 location段配置信息,location配置中维护微服务编码上下文信息
# app_code: metadata-ui 流水线名称: metadata-ui
location ~ ^/metadata-ui/(?P.*) {set $app_code metadata-ui;p…统一nginx接入配置指南
Nginx配置规范
1:不带微服务编码上下文至后端,以metadata-ui为例 location段配置信息,location配置中维护微服务编码上下文信息
# app_code: metadata-ui 流水线名称: metadata-ui
location ~ ^/metadata-ui/(?P.*) {set $app_code metadata-ui;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Host $http_host;proxy_http_version 1.1;proxy_set_header Connection ;if ( $nginx-flag out-nginx){set $nginx public;}include crossDomain.conf;proxy_set_header x-network-type $yonyoubipnginx;proxy_set_header Host $target_ingress;proxy_pass http://$target_ingress/$URI$is_args$args;
}# map信息 【非共享配置各领域须适配自己所属领域的配置并追加到此map文件中】
map $app_code $target_ingress {
# app_code: metadata-ui 流水线名称: metadata-uimetadata-ui pre-metadata-ui.k8s.com;
}
2:带微服务编码上下文至后端,以doc-material为例 location段配置信息,location配置中维护微服务编码上下文信息
# app_code: doc-material 流水线名称: pc-server
location ~ ^/doc-material {set $app_code doc-material;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Host $http_host;proxy_http_version 1.1;proxy_set_header Connection ;if ( $nginx-flag out-nginx){set $nginx public;}include crossDomain.conf;proxy_set_header x-network-type $nginx;proxy_set_header Host $target_ingress;proxy_pass http://$target_ingress;
}
# map信息
map $app_code $target_ingress {
# app_code: doc-material 流水线名称: pc-serverdoc-material doc-material.k8s.com;
}
添加nginx配置
1、create master
GitLab 也宣布 使用main代替master作为新的默认分支名。所以后续新建项目即默认main分支了。
①在GitLab上新建项目test后进入test项目点击左侧Repository-Branches
可以看到里面只有一个受保护的默认分支main此处无法删除。
然后新建分支master点击右上角New branch输入分支名字masterCreate branch。
②再点击左侧Settings-Repository
点开Default branch选择Default branch为masterSave Changes。
至此默认分支就是master了。
2、 cd existing_repo git init git remote add origin gitgit.aliyun.com:devops/nginx.git git add . git commit -m init git push -uf origin master
Linux系统挂载NAS文件系统 1、安装NFS客户端 如果您使用CentOS、Redhat、Aliyun Linux操作系统请执行以下命令 sudo yum install nfs-utils 如果您使用Ubuntu或Debian操作系统请执行以下命令 sudo apt-get update sudo apt-get install nfs-common 2、增加同时发起的NFS请求的数量
if (lsmod | grep sunrpc); then
(modinfo sunrpc | grep tcp_max_slot_table_entries) sysctl -w sunrpc.tcp_max_slot_table_entries128
(modinfo sunrpc | grep tcp_slot_table_entries) sysctl -w sunrpc.tcp_slot_table_entries128
fi
(modinfo sunrpc | grep tcp_max_slot_table_entries) echo options sunrpc tcp_max_slot_table_entries128 /etc/modprobe.d/alinas.conf
(modinfo sunrpc | grep tcp_slot_table_entries) echo options sunrpc tcp_slot_table_entries128 /etc/modprobe.d/alinas.conf
3、创建目录 mkdir /middleware /docker /data/maven /systemlog /data/cloudproduct /var/yRelease 4、挂载NAS sudo mount -t nfs -o vers4,minorversion0,rsize1048576,wsize1048576,hard,timeo600,retrans2,noresvport 1d5014af0d-dbu83.cn-beijing.nas.aliyuncs.com:/middleware /middleware sudo mount -t nfs -o vers4,minorversion0,rsize1048576,wsize1048576,hard,timeo600,retrans2,noresvport 1d5014af0d-dbu83.cn-beijing.nas.aliyuncs.com:/docker /docker sudo mount -t nfs -o vers4,minorversion0,rsize1048576,wsize1048576,hard,timeo600,retrans2,noresvport 1d5014af0d-dbu83.cn-beijing.nas.aliyuncs.com:/maven /data/maven sudo mount -t nfs -o vers4,minorversion0,rsize1048576,wsize1048576,hard,timeo600,retrans2,noresvport 1d5014af0d-dbu83.cn-beijing.nas.aliyuncs.com:/systemlog /systemlog sudo mount -t nfs -o vers3,noacl,nolock,prototcp,rsize1048576,wsize1048576,hard,timeo600,retrans2,noresvport 01137036-1gqo.cn-beijing.extreme.nas.aliyuncs.com:/ /data/cloudproduct sudo mount -t nfs -o vers3,noacl,nolock,prototcp,rsize1048576,wsize1048576,hard,timeo600,retrans2,noresvport 1d5014af0d-dbu83.cn-beijing.nas.aliyuncs.com:/ /var/yRelease
Linux内存管理神器smem工具