-1

I have nginx set up in a docker container (https://hub.docker.com/r/aptalca/nginx-letsencrypt/). Some changes were made (adding the last location block) and now nginx fails to start. Using the nginx config checker (nginx -t) it tells me that theres an error on line 74:

[emerg] unexpected end of file, expecting ";" or "}" in /config/nginx/site-confs/default:74

I've attached the contents of default, but I really cant see why this is coming up. From what I can tell all of my blocks are closed correctly. Line 74 references the very last line of the file:

server {
        listen       80;
        server_name  www.example.com, 192.168.187.10;
        rewrite ^ https://$http_host$request_uri? permanent;    # force redirect http to https
}


server {
        listen 443 ssl default_server;

        root /config/www;
        index index.html index.htm index.php;

        server_name www.example.com, 192.168.187.10;

        ssl_certificate /config/keys/fullchain.pem;
        ssl_certificate_key /config/keys/privkey.pem;
        ssl_dhparam /config/nginx/dhparams.pem;
        ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA$
        ssl_prefer_server_ciphers on;

        proxy_set_header X-Forwarded-For $remote_addr;
        add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
        client_max_body_size 0;

        location / {
                try_files $uri $uri/ /index.html /index.php?$args =404;
        }

        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

        location /couchpotato {
                proxy_pass http://192.168.187.10:5050/couchpotato;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /sonarr {
                proxy_pass http://192.168.187.10:8989/sonarr;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /deluge {
                proxy_pass http://192.168.187.10:8112/;
                proxy_set_header X-Deluge-Base "/deluge/";
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /emby {
                proxy_pass http://192.168.187.10:8096/emby;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /zm {
                proxy_pass http://192.168.187.10:808/zm;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

}

Can anyone see the problem?

1
  • 1
    The problem may be in a different file. You will need to look at all of the loaded configuration files. Jul 22, 2016 at 4:43

2 Answers 2

0

In my case, since the "ssl ciphers" line is so long, copying it using the mouse truncated it and dropped the ending semi-colon.

In nano, use ^K and ^U to cut and paste, respectively.

-1

Did you try that add semi colon to that line:

ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA$;

2
  • $ at the end of a line in some text editors in linux shows there is more to the line, there may be a missing ; at the end but we can't see the end of the line
    – Drifter104
    Jul 22, 2016 at 14:49
  • and maybe you missed to close single-quote
    – fyarci
    Oct 13, 2016 at 9:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .