#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
pid logs/nginx.pid;
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 443 ssl;
server_name baidu.com; #你的域名
root html; #前台文件存放文件夹,可改成别的
index index.html index.htm; #上面配置的文件夹里面的index.html
ssl_certificate baidu.com.crt; #改成你的证书的名字
ssl_certificate_key baidu.com.key; #你的证书的名字
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / { #默认请求页
root html;
index index.html index.htm;
}
location ~ .*\.(gif|jpg|jpeg|png)$ {
expires 24h;
root /opt/nginx/resources/; #指定存放路径
proxy_store on;
proxy_store_access user:rw group:rw all:rw;
proxy_temp_path /opt/nginx/resources/; #图片访问路径
proxy_redirect off;
pro
nginx配置Https请求
最新推荐文章于 2024-04-25 16:44:33 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)