nginx&letsencrypt-文件结尾,期望“;”或“}”

时间:2019-12-21 22:41:32

标签: docker ssl nginx lets-encrypt

我想用域名为 vip-75.com 的docker-compose设置nginx,但是我一直遇到这个问题,但看不到我的nginx.conf文件在哪里错误:

  

[emerg] 1#1:文件意外结束,期望为“;”或“}”中   /etc/letsencrypt/options-ssl-nginx.conf:2

下面是我的nginx.conf文件:

worker_processes 1;
events { worker_connections 1024; }

http {
    sendfile on;
    upstream shinyproxy {
        server shinyproxy:8080;
    }

    server {
        listen 80;
        server_name vip-75.com;
        server_tokens off;

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

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

    server {
        listen 443 ssl;
        server_name vip-75.com;
        server_tokens off;



        ssl_certificate       /etc/letsencrypt/live/vip-75.com/fullchain.pem;
        ssl_certificate_key   /etc/letsencrypt/live/vip-75.com/privkey.pem;
        include               /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_dhparam           /etc/letsencrypt/ssl-dhparams.pem;

        location / {
            proxy_pass         http://shinyproxy;

            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection "upgrade";
            proxy_read_timeout 600s;
            proxy_buffering    off;

            proxy_redirect     off;
            proxy_set_header   Host $host;
            proxy_set_header   X-Real-IP $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header   X-Forwarded-Host $server_name;
        }
    }
}

EDIT1
我在/home/ec2-user/data/certbot/conf/options-ssl-nginx.conf中看到 404未找到 但是在letsencrypt/文件夹中没有文件夹options-ssl-nginx.conf或文件etc/。 我遵循的教程是Nginx and Let’s Encrypt with Docker in Less Than 5 Minutes

0 个答案:

没有答案