nginx配置本地https
2021/11/3 7:12:53
本文主要是介绍nginx配置本地https,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
OpenSSL创建自签名证书
openssl req -sha256 -newkey rsa:2048 -nodes -keyout agsenterprise.key -x509 -days 3650 -out agsenterprise.crt -config /usr/local/etc/openssl@1.1/openssl.cnf -extensions v3_req
Common Name填写你要访问的域名地址
修改openssl.cnf文件
[ req ] req_extensions = v3_req # The extensions to add to a certificate request [ v3_req ] subjectAltName = @alt_names [ alt_names ] DNS.1 = chenfengami.com
nginx配置
server { listen 80; listen 443 ssl; ssl_certificate test/agsenterprise.crt; ssl_certificate_key test/agsenterprise.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; server_name chenfengami.com; location / { proxy_pass http://127.0.0.1:3000/; } }
将生成crt文件拖入并且添加信任
访问即可
参考: https://blog.csdn.net/zssai2015/article/details/85049905
这篇关于nginx配置本地https的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-09-17Nginx实用篇:实现负载均衡、限流与动静分离
- 2024-08-21宝塔nginx新增8022端口方法步骤-icode9专业技术文章分享
- 2024-08-21nginx配置,让ws升级为wss访问的方法步骤-icode9专业技术文章分享
- 2024-08-15nginx ws代理配置方法步骤-icode9专业技术文章分享
- 2024-08-14nginx 让访问带有/relid的地址返回404 ,例子 /relid-x-0.36-y-131.html-icode9专业技术文章分享
- 2024-08-14nginx 判断地址有/statics/的路径,指向到/home/html/statics/目录-icode9专业技术文章分享
- 2024-07-24解锁Nginx日志的宝藏:GoAccess——你的实时、交互式Web日志分析神器!
- 2024-03-29fail2ban nginx
- 2024-03-18install nginx proxy manager
- 2024-01-2444从零开始用Rust编写nginx,命令行参数的设计与解析及说明