【问题标题】:How do I enable HTTPS on my Nginx server on Oracle cloud如何在 Oracle 云上的 Nginx 服务器上启用 HTTPS
【发布时间】:2022-02-21 16:52:40
【问题描述】:

所以我试图在我的网站上设置 https,托管在 oracle 云虚拟机上,运行 ubuntu。 该网站在没有 https 的情况下运行良好,但我宁愿它与 https 一起使用。 我的域名:rayyanshikoh.ga(通过freenom学习测试)

我的配置文件:

server {
    listen 80;
    server_name 129.151.159.179 rayyanshikoh.ga www.rayyanshikoh.ga;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/ubuntu/personal-website/personal-website;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/run/gunicorn.sock;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/rayyanshikoh.ga/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/rayyanshikoh.ga/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}

我正在关注本教程: https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04

但是每当我尝试在 chrome 上使用 https 打开我的网站时,我都会收到错误消息:

This site can’t be reachedwww.rayyanshikoh.ga took too long to respond.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_TIMED_OUT

【问题讨论】:

    标签: nginx https virtual-machine oracle-cloud-infrastructure


    【解决方案1】:

    问题可能是安全列表未配置为允许通过 443 端口的流量。

    请检查附加到 VM 的安全列表并添加规则以允许 0.0.0.0: 443 ingress 流量。

    请尝试按照本指南了解如何配置安全列表。

    https://tutorialforlinux.com/2020/03/22/oracle-oci-compute-ubuntu-18-04-instance-open-port-443/2/

    免责声明:我目前为 OCI 工作,想法是我自己的,不代表 Oracle 或 OCI。

    【讨论】:

      猜你喜欢
      • 2021-10-15
      • 2016-08-28
      • 1970-01-01
      • 2018-02-28
      • 2013-04-15
      • 2015-05-28
      • 2016-02-04
      • 2019-05-06
      • 2020-12-15
      相关资源
      最近更新 更多