米狗

  • kubernets
  • docker
  • AWS
  • linux
  • nginx
Kratos
  1. 首页
  2. 中间件
  3. nginx
  4. 正文

nginx配置模板-网站https配置及80跳转443

2022年8月26日 562点热度 0人点赞 0条评论

nginx基本配置,网站https配置及http强调https

    ## THE IP INFOMATION OF "web-test.demo.com" ##
    upstream web-test.demo.com {
        server 10.100.40.101:32100;
    }
    ## THE SERVER INFOMATION OF "web-test.demo.com" ##
    server {
        listen 80;
        server_name web-test.demo.com;
        rewrite ^(.*)$ https://$host$1 permanent;
    }
    server {
        listen 443 ssl;
        server_name web-test.demo.com;
        ssl_certificate service2019.pem;
        ssl_certificate_key service2019.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES';
        ssl_prefer_server_ciphers on;
        
        location / {
            proxy_set_header SSL_CERT $ssl_client_cert;
            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_pass http://web-test.demo.com;
            client_max_body_size 100m;
            proxy_connect_timeout 75s;
            proxy_read_timeout 300s;
        }
    if ($request_method !~ ^(GET|HEAD|POST)$ ) {
        return 501;
    }


    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }
    location = /robots.txt {
        log_not_found off;
        access_log off;
    }
    }
标签: 暂无
最后更新:2022年9月5日

duhongjun

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

归档

  • 2024 年 10 月
  • 2024 年 4 月
  • 2024 年 3 月
  • 2024 年 2 月
  • 2024 年 1 月
  • 2023 年 11 月
  • 2023 年 4 月
  • 2023 年 2 月
  • 2023 年 1 月
  • 2022 年 11 月
  • 2022 年 10 月
  • 2022 年 9 月
  • 2022 年 8 月
  • 2021 年 12 月
  • 2021 年 11 月
  • 2021 年 8 月
  • 2021 年 7 月
  • 2021 年 6 月
  • 2021 年 2 月
  • 2020 年 1 月
  • 2019 年 12 月
  • 2019 年 11 月
  • 2019 年 10 月
  • 2019 年 9 月
  • 2019 年 8 月

分类目录

  • AWS
  • docker
  • elasticsearch
  • Jenkins
  • kubernets
  • linux
  • mysql
  • nginx
  • Oracle
  • php
  • redis
  • zabbix
  • 个人
  • 中间件
  • 公有云
  • 大数据
  • 安全工具
  • 微软
  • 操作系统
  • 数据库
  • 未分类
  • 监控
  • 科技
  • 网络技术
  • 资讯
  • 阿里云

COPYRIGHT © 2024 米狗. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

沪ICP备2021019346号-1