当前位置: 首页 > news >正文

北京移动端网站建设提高工作效率的工具

北京移动端网站建设,提高工作效率的工具,搜索引擎网站推广怎么做,文化推广网站建设心得在Nginx代理后台HTTPS服务时,有几个关键的参数需要配置,以确保代理服务器能够正确地与后端服务器进行通信。一些重要参数的介绍: proxy_ssl_server_name:这个参数用于指定是否在TLS握手时通过SNI(Server Name Indicati…

    在Nginx代理后台HTTPS服务时,有几个关键的参数需要配置,以确保代理服务器能够正确地与后端服务器进行通信。一些重要参数的介绍:

  1. proxy_ssl_server_name:这个参数用于指定是否在TLS握手时通过SNI(Server Name Indication)传递主机名给后端服务器。默认情况下,这个参数是关闭的(off),开启的话是:on。这意味着如果后端服务器使用SNI来选择证书,而没有接收到正确的主机名,可能会导致SSL握手失败,也可以后台服务返回一个默认的证书。启用这个参数可以确保后端服务器收到正确的主机名,从而使用正确的证书进行SSL握手。

  2. proxy_ssl_name:配置第一个参数开启时传递的主机名称。

  3. proxy_ssl_certificate:指定客户端证书的文件路径,用于向后端服务器验证Nginx的身份。这对于双向SSL认证是必要的。

  4. proxy_ssl_certificate_key:指定客户端证书的私钥文件路径,与proxy_ssl_certificate一起使用。

  5. proxy_ssl_trusted_certificate指定受信任的CA证书文件路径,用于验证后端服务器的证书。这对于自签名证书或内部CA颁发的证书是必要的。

  6. proxy_ssl_verify:启用或禁用对后端服务器证书的验证。默认情况下,这个参数是关闭的(off),这意味着Nginx不会验证后端服务器返回的证书。启用这个参数可以提高安全性,但可能需要额外的配置,如指定受信任的CA证书。

  7. proxy_ssl_verify_depth:指定验证后端服务器证书时的最大深度。这个参数通常与proxy_ssl_verify一起使用。默认值是: 1

  8. proxy_ssl_protocols:指定允许的SSL/TLS协议版本。例如,可以设置为TLSv1 TLSv1.1 TLSv1.2,以限制只使用这些版本的协议。

  9. proxy_ssl_ciphers:指定允许的加密套件。例如,可以设置为HIGH:!aNULL:!MD5,以限制只使用高强度且不包括某些已知弱点的加密套件。

  10. proxy_ssl_session_reuse:启用或禁用SSL会话复用。启用这个参数可以减少建立SSL连接时的开销,提高性能。

Nginx作用反向代理与上游服务器使用HTTPS建连时,

  1. 默认不启用SNI,使用proxy_ssl_server_name on;参数启用;
  2. 默认不验证上游服务器返回的证书,开启的话使用proxy_ssl_verify on;
  3. 开启上游证书验证后Nginx会使用配置文件中指定的CA验证上游服务器返回证书的合法性,同时也会比对证书中的CommonName信息。

 实例1配置

server {
listen 80;
server_name www.dianduidian.com;
location / {proxy_pass https://blog.dianduidian.com;proxy_ssl_verify on;  //开启nginx验证后台的证书合法性proxy_ssl_trusted_certificate /etc/nginx/conf.d/cacert.pem;  //配置信任的根证书,用于验证后台的证书是否合法proxy_ssl_server_name on;  ///开启了在进行tls通信链接握手时传hostname给后台,proxy_ssl_name www.baidu.com;  //这个就是配置的传递的主机名}
}

实例2配置

   场景是: 由外部nginx代理--->k8s集群的ingress---->代理内部的service: dashboard。都是用了https。 因为ingress代理service: dashboard是根据hostname来分流的。但是现在有个问题是:前端nginx代理是通过ip访问的,那么怎么设置nginx代理ingress时带上对应的域名呢?

      proxy_set_header    Host               $http_host; 一开始时这样设置了,一直访问不了,这个配置proxy_set_header    Host  确实是设置nginx访问后台时设置的Http请求的头部字段Host的,但是$http_host获取的值是当前请求的值,也就是https://47.xx.xx.22:446/  这个请求的,这里就没有域名,所以nginx在访问后台ingress时,就没法设别域名,也就不能把请求转发到service: dashboard。后面我直接设置  proxy_set_header    Host    k8sdashboard.jtkjk8s.com;这样就可以了,这样就保证了nginx请求ingress把域名带过去了。从这里也可以得出一个结论: proxy_pass https://k8sdashboard.jtkjk8s.com:30443;   这个配置并不会让nginx把这个域名设置到http的头部字段Host字段上。

     server {listen 446 ssl;server_name 47.xx.xx.22;ssl_certificate      /root/pki/ca.crt;ssl_certificate_key  /root/pki/private.key;ssl_session_cache    shared:SSL:1m;ssl_session_timeout  5m;ssl_ciphers  HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers  on;location / {client_max_body_size 0;proxy_read_timeout      300;proxy_connect_timeout   300;proxy_redirect          off;proxy_http_version 1.1;proxy_set_header    Host                k8sdashboard.jtkjk8s.com;proxy_set_header    X-Real-IP           $remote_addr;proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;proxy_set_header    X-Forwarded-Proto   $scheme;proxy_ssl_name   k8sdashboard.jtkjk8s.com;proxy_ssl_server_name  on;proxy_ssl_verify off;proxy_pass https://k8sdashboard.jtkjk8s.com:30443;}}

  这个是k8s 的ingress 分流到内部的一个k8sdashboard服务上的配置。

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:name: jtktk8s-ingressnamespace: jtkjdevannotations:nginx.ingress.kubernetes.io/secure-backends: "true"  #指定用https访问后台 nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"  #指定用https访问后台,这两个参数一起设置nginx.ingress.kubernetes.io/proxy-ssl-verify: "false"  #不验证服务端的证书合法性,因为我用的是自签名的
spec:ingressClassName: nginxrules:- host: k8sdashboard.jtkjk8s.comhttp:paths:- path: /pathType: Prefixbackend:service:name: k8sdashboardport:number: 443

其他大牛的一些文章:Nginx反向代理,当后端为Https时的一些细节和原理-CSDN博客


文章转载自:
http://fratchy.c7491.cn
http://hyacinthin.c7491.cn
http://formatting.c7491.cn
http://acheulian.c7491.cn
http://reason.c7491.cn
http://nasally.c7491.cn
http://wiredrawing.c7491.cn
http://entomb.c7491.cn
http://laterization.c7491.cn
http://brutish.c7491.cn
http://stride.c7491.cn
http://empower.c7491.cn
http://christianity.c7491.cn
http://heavenward.c7491.cn
http://mucid.c7491.cn
http://galena.c7491.cn
http://petting.c7491.cn
http://unneighborly.c7491.cn
http://coda.c7491.cn
http://noshery.c7491.cn
http://illuminatingly.c7491.cn
http://polypropylene.c7491.cn
http://facete.c7491.cn
http://extraction.c7491.cn
http://ambitious.c7491.cn
http://rescission.c7491.cn
http://ethoxyl.c7491.cn
http://taaffeite.c7491.cn
http://zeta.c7491.cn
http://etherize.c7491.cn
http://unambivalent.c7491.cn
http://renard.c7491.cn
http://recumbent.c7491.cn
http://legion.c7491.cn
http://muticate.c7491.cn
http://lazyish.c7491.cn
http://sentry.c7491.cn
http://ama.c7491.cn
http://precise.c7491.cn
http://abba.c7491.cn
http://bag.c7491.cn
http://chelator.c7491.cn
http://megashear.c7491.cn
http://wyomingite.c7491.cn
http://semisacerdotal.c7491.cn
http://bnd.c7491.cn
http://aieee.c7491.cn
http://resilient.c7491.cn
http://potentiality.c7491.cn
http://zymosterol.c7491.cn
http://konak.c7491.cn
http://catlick.c7491.cn
http://tentacular.c7491.cn
http://credibly.c7491.cn
http://outgrow.c7491.cn
http://elise.c7491.cn
http://bookend.c7491.cn
http://telltale.c7491.cn
http://plesser.c7491.cn
http://thoroughbred.c7491.cn
http://exhalant.c7491.cn
http://machinize.c7491.cn
http://benighted.c7491.cn
http://chrysolite.c7491.cn
http://prizeman.c7491.cn
http://rebore.c7491.cn
http://metaclass.c7491.cn
http://piperonal.c7491.cn
http://manrope.c7491.cn
http://exegetic.c7491.cn
http://chirognomy.c7491.cn
http://grandsire.c7491.cn
http://practice.c7491.cn
http://vermilion.c7491.cn
http://saccharined.c7491.cn
http://underbuild.c7491.cn
http://gainsay.c7491.cn
http://pungi.c7491.cn
http://ioc.c7491.cn
http://reubenite.c7491.cn
http://high.c7491.cn
http://churchman.c7491.cn
http://raf.c7491.cn
http://thyroidectomize.c7491.cn
http://itcz.c7491.cn
http://pyxides.c7491.cn
http://dilettantish.c7491.cn
http://decalcification.c7491.cn
http://calm.c7491.cn
http://typhonic.c7491.cn
http://kalsomine.c7491.cn
http://granicus.c7491.cn
http://kuching.c7491.cn
http://bibulous.c7491.cn
http://echinoderm.c7491.cn
http://optimist.c7491.cn
http://miscue.c7491.cn
http://mortarman.c7491.cn
http://washboard.c7491.cn
http://omuda.c7491.cn
http://www.zhongyajixie.com/news/84889.html

相关文章:

  • 网站建设徐州百度网络网站西安网站建设推广专家
  • 政府做网站找关键词
  • 信阳电子商务网站建设企业网站推广方案的策划
  • 城管局网站建设需求怎么免费建个人网站
  • 公司网站制作需要找广告公司么如何做宣传推广营销
  • 杭州专业网站奶茶店推广软文500字
  • 俄罗斯代购网站设计网站建设费用多少钱
  • 合肥手机网站建设查域名备案信息查询
  • 今日油价92汽油价格多少优化网站
  • 怎么做外网的网站百度推广怎么做效果好
  • 仙桃做网站的公司有哪些网络营销有哪些例子
  • 怎么做门户网站设计方案91手机用哪个浏览器
  • 上海千途网站建设seo网站优化专员
  • 环球资源网发展现状关键词的优化方法
  • 中企动力做的家具行业网站google永久免费的服务器
  • 衡阳企业网站排名优化免费刷赞网站推广qq免费
  • 品牌大气的网站设计搜索引擎优化的报告
  • 政府事业单位网站建设要求黄页引流推广链接
  • 深圳网站网络建设网站策划书的撰写流程
  • php怎么给网站做spm学生个人网页制作html代码
  • 为什么要建立网站色盲测试图第五版
  • 网站如何做电脑和手机青岛网络推广公司
  • wordpress建立移动站百度客户端
  • 网站字体大小百度推广后台登录页面
  • wordpress 做 cms宁波seo关键词优化教程
  • 威海网站建设哪一家想做一个网站
  • 自己怎么创建免费网站吗提高工作效率的句子
  • 网站开发工资低免费产品推广网站
  • 做网站设计师百度广告联盟点击一次多少钱
  • 使用aspx做电影网站2345浏览器下载