我正在尝试配置Ansible
NGINX
部署作业,以便在NGINX
服务器上启用HTTPS
。
我可以看到nginx.conf.je
有http{...}
。对于HTTPS
,我需要类似的东西吗?或者这是如何配置的?
您必须在nginx.conf文件-上按如下方式配置它
events {}
http {
server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate www.exaple.com.crt;
ssl_certificate_key www.example.com.key;
location / {
return 200 "Nginx is running";
}
}
}
在nginx.org/en/docs:http/configuring_https_servers.html上找到了这个。