• nginx https配置模板


    正文

    user  root;
    worker_processes  1;
    
    #error_log  /usr/local/nginx/logs/error.log error;
    #error_log  /usr/local/nginx/logs/error.log  notice;
    #error_log  /usr/local/nginx/logs/error.log  info;
    #pid        logs/nginx.pid;
    
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
        
        #开启http的debug level 系统日志 
        error_log  /usr/local/nginx/logs/error.log debug;
    
        #定义访问日志格式并使用
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
            '$status $body_bytes_sent "$http_referer" '
            '"$http_user_agent" "$http_x_forwarded_for"';
        access_log  /usr/local/nginx/logs/access.log  main;
    
        #使用sendfile 内核拷贝传输文件
        sendfile        on;
    
        keepalive_timeout  65;
    
        server {
    
            # 单IP多域名的时候使用,可分不到不同的server块,此处不必
            #server_name  120.79.215.199 host1.sshsu.top; 
    
            #开启ssl: nginx version > 1.15.0 
            listen  8086 ssl;
    
            #开启ssl: nginx version < 1.15.0
            #listen 8086;
            #ssl on;
    
            
            charset utf-8;
            ssl_session_cache shared:SSL:10m;
            ssl_session_timeout 10m;
    
            #设置证书和私钥
            ssl_certificate /root/certs/Nginx/1_host1.sshsu.top_bundle.crt;
            ssl_certificate_key /root/certs/Nginx/2_host1.sshsu.top.key; 
    
            # 路径匹配
            location / { 
                root /root/git/janus-gateway/html;
                index  index.html index.htm;
            }
        }
    }
    
  • 相关阅读:
    第01组 Beta版本演示
    2019 SDN上机第7次作业
    第01组 Beta冲刺(4/4)
    系统综合实践第6次作业
    系统综合实践第5次作业
    系统综合实践第4次作业
    系统综合实践第3次作业
    系统综合实践第2次作业
    系统综合实践第1次作业
    软工实践个人总结
  • 原文地址:https://www.cnblogs.com/ishen/p/12217697.html
Copyright © 2020-2023  润新知