SSL + Http2
怎么配置 SSL 貌似好麻烦的样子。
相关帖子
-
server { listen 80; server_name jingxuetao.com www.jingxuetao.com; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; location / { #rewrite ^(.*) https://$server_name$1 permanent; #return 301 https://$server_name$request_uri; return 301 https://jingxuetao.com$request_uri; } }
上面是 HTTP 文件配置,default.conf
server { listen 443 ssl http2; server_name jingxuetao.com; server_tokens off; #SSL配置 ssl on; ssl_certificate /etc/nginx/cert.crt;#证书路径 ssl_certificate_key /etc/nginx/cert.key; add_header Strict-Transport-Security "max-age=31536000;"; add_header X-Frame-Options deny; add_header X-Content-Type-Options nosniff; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:2368; client_max_body_size 5m; } }
上面是 HTTPS 文件配置 ssl.conf 文件.
- 其他回帖
-
-
-
- 查看全部回帖
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于