Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用certbot和nginx启用SSL_Ssl_Nginx_Strapi_Certbot - Fatal编程技术网

使用certbot和nginx启用SSL

使用certbot和nginx启用SSL,ssl,nginx,strapi,certbot,Ssl,Nginx,Strapi,Certbot,我正试图在我的Strapi产品上设置httpS,但这非常困难。我遵循了德里克梅哈菲的著作,但它对我不起作用( 我的pm2服务: My/etc/nginx/conf.d/upstream.conf文件: # Strapi upstream server upstream strapi-gatsby { server localhost:1337; } server { # Listen HTTP listen 80; server_name strapi.live-fo

我正试图在我的Strapi产品上设置httpS,但这非常困难。我遵循了德里克梅哈菲的著作,但它对我不起作用(

我的pm2服务:

My/etc/nginx/conf.d/upstream.conf文件:

# Strapi upstream server
upstream strapi-gatsby {
    server localhost:1337;
}
server {
# Listen HTTP
    listen 80;
    server_name strapi.live-for-good.org;
# Define LE Location
    location ~ ^/.well-known/acme-challenge/ {
      default_type "text/plain";
      root         /var/www/html;
    }
# Else Redirect to HTTPS // API
#    location / {
#      return 301 https://$host$request_uri;
#    }
}
My/etc/nginx/sites available/strapi.live-for-good.org.conf文件:

# Strapi upstream server
upstream strapi-gatsby {
    server localhost:1337;
}
server {
# Listen HTTP
    listen 80;
    server_name strapi.live-for-good.org;
# Define LE Location
    location ~ ^/.well-known/acme-challenge/ {
      default_type "text/plain";
      root         /var/www/html;
    }
# Else Redirect to HTTPS // API
#    location / {
#      return 301 https://$host$request_uri;
#    }
}
我清除了可用站点中的默认程序包和启用站点中的默认程序包,创建了链接,当我想用服务nginx configtest检查它时,它失败了

但是,当我启动sudo nginx-t&&sudo服务nginx reload时,我得到了以下信息:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
系统
请在访问网站时提供错误代码?是否有
strapi.live for good.org
domain的SSL配置文件?我以前试图使用cerbot教程安装cerbot,因此有一个配置,但不起作用。请在访问网站时提供错误代码?是否有任何SSL配置文件
strapi.live for good.org
domain?我以前尝试过使用cerbot教程安装cerbot,所以有一个配置,但不起作用