• 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;
            }
        }
    }
    
  • 相关阅读:
    黑马程序员_Java学习日记num13
    黑马程序员_Java学习日记num12
    黑马程序员_Java学习日记num11
    黑马程序员_Java学习日记num10
    黑马程序员_Java学习日记num9
    黑马程序员_Java学习日记num8
    黑马程序员_Java学习日记num7
    黑马程序员_Java学习日记num6
    黑那程序员_Java学习日记num5
    Happy May!
  • 原文地址:https://www.cnblogs.com/ishen/p/12217697.html
Copyright © 2020-2023  润新知