Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.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
Nginx没有';t使用certbot letsencrypt在https中工作_Nginx_Lets Encrypt_Certbot - Fatal编程技术网

Nginx没有';t使用certbot letsencrypt在https中工作

Nginx没有';t使用certbot letsencrypt在https中工作,nginx,lets-encrypt,certbot,Nginx,Lets Encrypt,Certbot,我已经执行了certbot web中显示的步骤,并且已经生成了证书。它们位于/etc/letsencrypt/live/example.com/中,这是我的/etc/nginx/sites available/default: # Default server configuration # server { listen 80 default_server; #listen [::]:80 default_server; root /var/www/html; # Add index.ph

我已经执行了certbot web中显示的步骤,并且已经生成了证书。它们位于
/etc/letsencrypt/live/example.com/
中,这是我的
/etc/nginx/sites available/default

# Default server configuration
#
server {
listen 80 default_server;
#listen [::]:80 default_server;

root /var/www/html;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;

# server_name _;
server_name example.com;

location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
#   deny all;
#}

listen 443 ssl; # managed by Certbot

ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;      # managed by Certbot
ssl_session_cache shared:le_nginx_SSL:1m; # managed by Certbot
ssl_session_timeout 1440m; # managed by Certbot

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # managed by Certbot
ssl_prefer_server_ciphers on; # managed by Certbot

ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES128-SHA ECDHE-ECDSA-AES256-SHA ECDHE-ECDSA-AES128-SHA256 ECDHE-ECDSA-AES256-SHA384 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-SHA ECDHE-RSA-AES128-SHA256 ECDHE-RSA-AES256-SHA384 DHE-RSA-AES128-GCM-SHA256 DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES128-SHA DHE-RSA-AES256-SHA DHE-RSA-AES128-SHA256 DHE-RSA-AES256-SHA256 EDH-RSA-DES-CBC3-SHA"; # managed by Certbot

if ($scheme != "https") {
  return 301 https://$host$request_uri;
} # managed by Certbot

}
如果我进入example.com,它会很好地重定向到

问题是,它总是显示一个错误,表明显示页面时出错

DNS通过一个条目(例如.com)进行了良好的重定向


PD:假设example.com是我的域

我忘了重定向路由器中的443端口