diff --git a/letsencrypt/client/plugins/nginx/parser.py b/letsencrypt/client/plugins/nginx/parser.py index 6fc5bef53..f8a21d72b 100644 --- a/letsencrypt/client/plugins/nginx/parser.py +++ b/letsencrypt/client/plugins/nginx/parser.py @@ -96,6 +96,7 @@ class NginxParser(object): :rtype: bool """ + # Look for a server block that contains 'listen [port] ssl' return False def get_vhosts(self): diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/nginx.conf b/letsencrypt/client/plugins/nginx/tests/testdata/nginx.conf index 67566604e..ce8e525ef 100644 --- a/letsencrypt/client/plugins/nginx/tests/testdata/nginx.conf +++ b/letsencrypt/client/plugins/nginx/tests/testdata/nginx.conf @@ -14,7 +14,7 @@ events { worker_connections 1024; } -include foo.conf +include foo.conf; http { include mime.types; diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/nginx.new.conf b/letsencrypt/client/plugins/nginx/tests/testdata/nginx.new.conf index 210861593..e53ed29c9 100644 --- a/letsencrypt/client/plugins/nginx/tests/testdata/nginx.new.conf +++ b/letsencrypt/client/plugins/nginx/tests/testdata/nginx.new.conf @@ -6,6 +6,67 @@ error_log logs/error.log info; pid logs/nginx.pid; events { worker_connections 1024; +} +include foo.conf; +http { + include mime.types; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + access_log logs/access.log main; + sendfile on; + tcp_nopush on; + keepalive_timeout 0; + keepalive_timeout 65; + gzip on; + + server { + listen 8080; + server_name localhost; + charset koi8-r; + access_log logs/host.access.log main; + + location / { + root html; + index index.html index.htm; + } + error_page 404 /404.html; + error_page 500 502 503 504 /50x.html; + + location = /50x.html { + root html; + } + + location ~ \.php$ { + proxy_pass http://127.0.0.1; + } + + location ~ \.php$ { + root html; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + include fastcgi_params; + } + + location ~ /\.ht { + deny all; + } + } + + server { + listen 8000; + listen somename:8080; + include server.conf; + + location / { + root html; + index index.html index.htm; + } + } + include conf.d/test.conf; + include sites-enabled/*; server { listen 443 ssl; diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/server.conf b/letsencrypt/client/plugins/nginx/tests/testdata/server.conf new file mode 100644 index 000000000..5fc4c8b24 --- /dev/null +++ b/letsencrypt/client/plugins/nginx/tests/testdata/server.conf @@ -0,0 +1 @@ +server_name somename alias another.alias;