nginx https配置模板
Posted woder
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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;
}
}
}
以上是关于nginx https配置模板的主要内容,如果未能解决你的问题,请参考以下文章
nginx.conf 忽略了 nginx-ingress 配置映射片段
[AndroidStudio]_[初级]_[配置自动完成的代码片段]
[AndroidStudio]_[初级]_[配置自动完成的代码片段]