Nginx的https配置
参考地址(阿里云提交的教程链接):
https://help.aliyun.com/document_detail/212905.html?spm=5176.b657008.help.dexternal.14ae1b48aHgR
遇到的错误:
1、nginx: [emerg] the “ssl” parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:99
提示 Nginx 缺少 http_ssl_module 模块。
cd /usr/local/nginx-1.20.1
./configure --with-http_ssl_module
make
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
./nginx -s stop
cp /usr/local/nginx-1.20.1/objs/nginx /usr/local/nginx/sbin/
./nginx
nginx -V
2、nginx: [emerg] no “ssl_certificate” is defined for the “listen … ssl” directive in /usr/local/nginx/conf/nginx.conf:98
nginx.conf文件的https server配置,我使用下面的配置之后就不报错了:
server {
listen 443 ssl;
server_name www.zhanjiang.work;
ssl_certificate /usr/local/nginx/cert/sslconfigure.pem;
ssl_certificate_key /usr/local/nginx/cert/sslconfigure.key;
location / {
root html;
index index.html index.htm;
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)