在NGINX服务器上提供HTTPS流量



我正在尝试配置AnsibleNGINX部署作业,以便在NGINX服务器上启用HTTPS

我可以看到nginx.conf.jehttp{...}。对于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上找到了这个。

最新更新