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

Nginx SSL配置协议

一二三5年前 (2020-12-02)Centos828
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
分享给朋友:

相关文章

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

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

mysql(mariadb)数据库集群故障处理及数据导入导出

1、3台数据库的集群(版本为mariadb10.3.8),有一台服务器down,另外两台就无法工作了--- 脑裂了!: WSREP has not yet&n...

CentOS查看端口使用情况

netstat -ntlp   //列出所有netstat -ntlp |grep 80    //显示80端口使用信息。...

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

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

1、准备机器名称网卡0网卡1VIPlvsmaster58.218.92.185(网关:58.218.92.1)10.77.1.20(不配置网关)58.218.92.187lvsbackup58.218...

Centos7 yum 安装 keepalived

1、安装epel源,方便后面安装keepalivedyum install epel-release -y2、安装keepalivedyum install keepalived -y3、常用命令开机...

centos7 添加磁盘到/(根目录下),扩展VG卷和lv

1.创建pvfdisk /dev/xvdc输入n增加分区输入p类型设置为:主分区输入1分区编号设置为1回车 为默认大小回车 为默认 大小输入w退出2.把pv加入vg中,相当于扩充vg的大小扩展vg,使...