小编Nik*_*rom的帖子

Nginx 对 https 请求返回 400

我已经使用 letencrypt 设置了 nginx 以使用 https。我/etc/nginx/conf.d/app.conf的如下(没有server配置其他指令):

server {

        location /.well-known/acme-challenge/ {
                autoindex on;
                root /var/www/certbot/;
        }

        location / {
                return 301 https://$host$request_uri;
        }

        server_name example.com;
        listen 80;
}

server {
        listen 443;
        ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

        server_name example.com;

        location /.well-known/acme-challenge/ {
                root /var/www/certbot;
        }

        location /static/ {
                gzip on;
                gzip_static on;
                gzip_types text/plain text/css text/javascript application/javascript;
                gzip_disable "msie6";

                alias /static/;
                autoindex off;
        }

        # many other locations
}
Run Code Online (Sandbox Code Playgroud)

当我尝试打开时https://example.com,nginx 返回 …

nginx https docker

8
推荐指数
1
解决办法
5995
查看次数

标签 统计

docker ×1

https ×1

nginx ×1