当前位置:首页 > 服务器系统 > Centos > 正文内容

Nginx SSL配置协议

一二三6年前 (2020-12-02)Centos1003
upstream web_backends_80 {
  ip_hash; #每个请求按访问ip的hash结果分配可以解决session的问题。
  server 10.88.1.17:80;#web端1
  server 10.88.1.18:80;#web端2
}
server {
  listen    80;
  listen    443 ssl;
  server_name  test.xz.domain.com;
  if ($server_port !~ 443){
     rewrite ^(/.*)$ https://$host$1 permanent;
  }
  charset utf-8;
  add_header X-Xss-Protection 1;
  ssl_certificate /data/test.xz.e2cs.com/1_test.xz.e2cs.com_bundle.pem;
  ssl_certificate_key /data/test.xz.e2cs.com/0_test.xz.e2cs.com.key;
  proxy_redirect off; #重定向url
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $http_host;
  location / {
    proxy_pass http://web_backends_80;
  }
}


扫描二维码至手机访问

扫描二维码推送至手机访问。

版权声明:本文由一二三博客发布,如需转载请注明出处。

标签: Nginx
分享给朋友:

相关文章

centos_7 mariadb 的最大连接数max_connections修改

输入show variables like 'max_connections'; 一、修改mariadb.service vim /us...

Centos修改MTU(巨型帧)

ifconfig eth1 mtu 9000 up      //执行命令后,实时生效。重启失效。MTU=&q...

Centos7 使用scp命令进行数据迁移

复制文件(本地>>远程):scp -P 33699 /etc/nginx/conf.d/default.conf root@10.88.1.23:/...

CentOS7 配置163 yum源

1、下载repo文件 wget http://mirrors.163.com/.help/CentOS7-Base-163.repo2、备份并替换系统的repo文件 cp Cent...

Nginx TCP协议配置

stream {     upstream zifangsky {      ...

Centos7 LVS+Keepalived+Nginx基于DR模式构建高可用方案

Centos7 LVS+Keepalived+Nginx基于DR模式构建高可用方案

1、准备机器名称网卡0网卡1VIPlvsmaster192.218.92.185(网关:192.218.92.1)10.88.1.20(无网关)内网通信使用192.218.92.187lvsbacku...