{"action":"created","issue":{"url":"https://api.github.com/repos/certbot/certbot/issues/4930","repository_url":"https://api.github.com/repos/certbot/certbot","labels_url":"https://api.github.com/repos/certbot/certbot/issues/4930/labels{/name}","comments_url":"https://api.github.com/repos/certbot/certbot/issues/4930/comments","events_url":"https://api.github.com/repos/certbot/certbot/issues/4930/events","html_url":"https://github.com/certbot/certbot/issues/4930","id":242946848,"number":4930,"title":"Support Perl-style named capture syntax in Nginx","user":{"login":"bytespider","id":91801,"avatar_url":"https://avatars0.githubusercontent.com/u/91801?v=4","gravatar_id":"","url":"https://api.github.com/users/bytespider","html_url":"https://github.com/bytespider","followers_url":"https://api.github.com/users/bytespider/followers","following_url":"https://api.github.com/users/bytespider/following{/other_user}","gists_url":"https://api.github.com/users/bytespider/gists{/gist_id}","starred_url":"https://api.github.com/users/bytespider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bytespider/subscriptions","organizations_url":"https://api.github.com/users/bytespider/orgs","repos_url":"https://api.github.com/users/bytespider/repos","events_url":"https://api.github.com/users/bytespider/events{/privacy}","received_events_url":"https://api.github.com/users/bytespider/received_events","type":"User","site_admin":false},"labels":[{"id":200587469,"url":"https://api.github.com/repos/certbot/certbot/labels/area:%20debian%20/%20ubuntu","name":"area: debian / ubuntu","color":"c5def5","default":false},{"id":272789317,"url":"https://api.github.com/repos/certbot/certbot/labels/area:%20error%20handling","name":"area: error handling","color":"c5def5","default":false},{"id":258836706,"url":"https://api.github.com/repos/certbot/certbot/labels/area:%20nginx","name":"area: nginx","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/certbot/certbot/milestones/5","html_url":"https://github.com/certbot/certbot/milestone/5","labels_url":"https://api.github.com/repos/certbot/certbot/milestones/5/labels","id":1134473,"number":5,"title":"Wishlist","description":"","creator":{"login":"pde","id":479213,"avatar_url":"https://avatars3.githubusercontent.com/u/479213?v=4","gravatar_id":"","url":"https://api.github.com/users/pde","html_url":"https://github.com/pde","followers_url":"https://api.github.com/users/pde/followers","following_url":"https://api.github.com/users/pde/following{/other_user}","gists_url":"https://api.github.com/users/pde/gists{/gist_id}","starred_url":"https://api.github.com/users/pde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pde/subscriptions","organizations_url":"https://api.github.com/users/pde/orgs","repos_url":"https://api.github.com/users/pde/repos","events_url":"https://api.github.com/users/pde/events{/privacy}","received_events_url":"https://api.github.com/users/pde/received_events","type":"User","site_admin":false},"open_issues":147,"closed_issues":42,"state":"open","created_at":"2015-05-26T17:47:38Z","updated_at":"2018-03-16T20:27:55Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2017-07-14T09:38:03Z","updated_at":"2018-04-17T06:49:50Z","closed_at":null,"author_association":"NONE","body":"## My operating system is (include version):\r\nUbuntu 14.04.5 LTS\r\nCertbot 0.14.2\r\n\r\n## I installed Certbot with (certbot-auto, OS package manager, pip, etc):\r\nOS package manager from PPA certbot/certbot\r\n\r\n## I ran this command and it produced this output:\r\n``` bash\r\ncertbot renew\r\n```\r\n\r\n```bash\r\n-------------------------------------------------------------------------------\r\nProcessing /etc/letsencrypt/renewal/proof.ace.bigroominternet.co.uk.conf\r\n-------------------------------------------------------------------------------\r\nCert is due for renewal, auto-renewing...\r\nRenewing an existing certificate\r\nPerforming the following challenges:\r\ntls-sni-01 challenge for proof.ace.bigroominternet.co.uk\r\ntls-sni-01 challenge for 1.ace.bigroominternet.co.uk\r\ntls-sni-01 challenge for 2.ace.bigroominternet.co.uk\r\ntls-sni-01 challenge for 3.ace.bigroominternet.co.uk\r\ntls-sni-01 challenge for 4.ace.bigroominternet.co.uk\r\ntls-sni-01 challenge for 5.ace.bigroominternet.co.uk\r\ntls-sni-01 challenge for 6.ace.bigroominternet.co.uk\r\ntls-sni-01 challenge for 7.ace.bigroominternet.co.uk\r\ntls-sni-01 challenge for 8.ace.bigroominternet.co.uk\r\ntls-sni-01 challenge for 9.ace.bigroominternet.co.uk\r\nCleaning up challenges\r\nAttempting to renew cert from /etc/letsencrypt/renewal/proof.ace.bigroominternet.co.uk.conf produced an unexpected error: Cannot find a VirtualHost matching domain 1.ace.bigroominternet.co.uk.. Skipping.\r\n```\r\n\r\n## Certbot's behavior differed from what I expected because:\r\nIt should have matched and renewed. As you can see I use a regular expression for my virtual host servername.\r\n\r\n## Here is a Certbot log showing the issue (if available):\r\n```\r\n2017-07-14 09:31:27,549:DEBUG:acme.client:Storing nonce: F90VgH0lY-qBYJht5yp6okoZoH9bVA3GRuKmBzrc6Yo\r\n2017-07-14 09:31:27,550:INFO:certbot.auth_handler:Performing the following challenges:\r\n2017-07-14 09:31:27,550:INFO:certbot.auth_handler:tls-sni-01 challenge for proof.ace.bigroominternet.co.uk\r\n2017-07-14 09:31:27,551:INFO:certbot.auth_handler:tls-sni-01 challenge for 1.ace.bigroominternet.co.uk\r\n2017-07-14 09:31:27,551:INFO:certbot.auth_handler:tls-sni-01 challenge for 2.ace.bigroominternet.co.uk\r\n2017-07-14 09:31:27,552:INFO:certbot.auth_handler:tls-sni-01 challenge for 3.ace.bigroominternet.co.uk\r\n2017-07-14 09:31:27,553:INFO:certbot.auth_handler:tls-sni-01 challenge for 4.ace.bigroominternet.co.uk\r\n2017-07-14 09:31:27,553:INFO:certbot.auth_handler:tls-sni-01 challenge for 5.ace.bigroominternet.co.uk\r\n2017-07-14 09:31:27,553:INFO:certbot.auth_handler:tls-sni-01 challenge for 6.ace.bigroominternet.co.uk\r\n2017-07-14 09:31:27,553:INFO:certbot.auth_handler:tls-sni-01 challenge for 7.ace.bigroominternet.co.uk\r\n2017-07-14 09:31:27,553:INFO:certbot.auth_handler:tls-sni-01 challenge for 8.ace.bigroominternet.co.uk\r\n2017-07-14 09:31:27,553:INFO:certbot.auth_handler:tls-sni-01 challenge for 9.ace.bigroominternet.co.uk\r\n2017-07-14 09:31:27,835:DEBUG:certbot.error_handler:Encountered exception:\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/dist-packages/certbot/auth_handler.py\", line 115, in _solve_challenges\r\n    resp = self.auth.perform(self.achalls)\r\n  File \"/usr/lib/python2.7/dist-packages/certbot_nginx/configurator.py\", line 805, in perform\r\n    sni_response = chall_doer.perform()\r\n  File \"/usr/lib/python2.7/dist-packages/certbot_nginx/tls_sni_01.py\", line 55, in perform\r\n    vhost = self.configurator.choose_vhost(achall.domain)\r\n  File \"/usr/lib/python2.7/dist-packages/certbot_nginx/configurator.py\", line 243, in choose_vhost\r\n    \"Cannot find a VirtualHost matching domain %s.\" % (target_name))\r\nMisconfigurationError: Cannot find a VirtualHost matching domain 1.ace.bigroominternet.co.uk.\r\n\r\n2017-07-14 09:31:27,835:DEBUG:certbot.error_handler:Calling registered functions\r\n2017-07-14 09:31:27,835:INFO:certbot.auth_handler:Cleaning up challenges\r\n2017-07-14 09:31:28,358:DEBUG:certbot_nginx.parser:Could not parse file: /etc/nginx/sites-enabled/default due to Expected \"#\" (at char 0), (line:1, col:1)\r\n2017-07-14 09:31:29,742:WARNING:certbot.renewal:Attempting to renew cert from /etc/letsencrypt/renewal/proof.ace.bigroominternet.co.uk.conf produced an unexpected error: Cannot find a VirtualHost matching domain 1.ace.bigroominternet.co.uk.. Skipping.\r\n2017-07-14 09:31:29,743:DEBUG:certbot.renewal:Traceback was:\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/dist-packages/certbot/renewal.py\", line 418, in handle_renewal_request\r\n    main.renew_cert(lineage_config, plugins, renewal_candidate)\r\n  File \"/usr/lib/python2.7/dist-packages/certbot/main.py\", line 640, in renew_cert\r\n    _get_and_save_cert(le_client, config, lineage=lineage)\r\n  File \"/usr/lib/python2.7/dist-packages/certbot/main.py\", line 77, in _get_and_save_cert\r\n    renewal.renew_cert(config, domains, le_client, lineage)\r\n  File \"/usr/lib/python2.7/dist-packages/certbot/renewal.py\", line 296, in renew_cert\r\n    new_certr, new_chain, new_key, _ = le_client.obtain_certificate(domains)\r\n  File \"/usr/lib/python2.7/dist-packages/certbot/client.py\", line 313, in obtain_certificate\r\n    self.config.allow_subset_of_names)\r\n  File \"/usr/lib/python2.7/dist-packages/certbot/auth_handler.py\", line 74, in get_authorizations\r\n    resp = self._solve_challenges()\r\n  File \"/usr/lib/python2.7/dist-packages/certbot/auth_handler.py\", line 115, in _solve_challenges\r\n    resp = self.auth.perform(self.achalls)\r\n  File \"/usr/lib/python2.7/dist-packages/certbot_nginx/configurator.py\", line 805, in perform\r\n    sni_response = chall_doer.perform()\r\n  File \"/usr/lib/python2.7/dist-packages/certbot_nginx/tls_sni_01.py\", line 55, in perform\r\n    vhost = self.configurator.choose_vhost(achall.domain)\r\n  File \"/usr/lib/python2.7/dist-packages/certbot_nginx/configurator.py\", line 243, in choose_vhost\r\n    \"Cannot find a VirtualHost matching domain %s.\" % (target_name))\r\nMisconfigurationError: Cannot find a VirtualHost matching domain 1.ace.bigroominternet.co.uk.\r\n```\r\n\r\n## Here is the relevant nginx server block or Apache virtualhost for the domain I am configuring:\r\n```\r\n server {\r\n        server_name ~^(?<sname>.+?).ace.bigroominternet.co.uk$;\r\n\r\n        root /var/www/acemedia/$sname/public;\r\n\r\n        error_log ../error.log;\r\n\r\n        error_page 500 501 502 503 504 $document_root/whoops.html;\r\n\r\n        charset UTF-8;\r\n\r\n        index index.php index.html;\r\n        client_max_body_size 60m;\r\n\r\n       location / {\r\n                try_files $uri $uri/ /index.php$is_args$args;\r\n        }\r\n\r\n        location ~ /\\.well-known\\/acme-challenge {\r\n                allow all;\r\n        }\r\n\r\n        location = /robots.txt { access_log off; log_not_found off; }\r\n        location = /humans.txt { access_log off; log_not_found off; }\r\n        location = /favicon.ico { access_log off; log_not_found off; }\r\n\r\n        location ~ \\.php$ {\r\n                try_files $uri =404;\r\n\r\n                fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;\r\n                fastcgi_index index.php;\r\n\r\n                include fastcgi_params;\r\n                fastcgi_read_timeout 1800s;\r\n        }\r\n\r\n        location ~ /\\. {\r\n                access_log off;\r\n                log_not_found off;\r\n                deny all;\r\n        }\r\n\r\n    listen 443 ssl; # managed by Certbot\r\nssl_certificate /etc/letsencrypt/live/proof.ace.bigroominternet.co.uk/fullchain.pem; # managed by Certbot\r\nssl_certificate_key /etc/letsencrypt/live/proof.ace.bigroominternet.co.uk/privkey.pem; # managed by Certbot\r\n    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/certbot/certbot/issues/comments/381867986","html_url":"https://github.com/certbot/certbot/issues/4930#issuecomment-381867986","issue_url":"https://api.github.com/repos/certbot/certbot/issues/4930","id":381867986,"user":{"login":"ohemorange","id":1227205,"avatar_url":"https://avatars0.githubusercontent.com/u/1227205?v=4","gravatar_id":"","url":"https://api.github.com/users/ohemorange","html_url":"https://github.com/ohemorange","followers_url":"https://api.github.com/users/ohemorange/followers","following_url":"https://api.github.com/users/ohemorange/following{/other_user}","gists_url":"https://api.github.com/users/ohemorange/gists{/gist_id}","starred_url":"https://api.github.com/users/ohemorange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohemorange/subscriptions","organizations_url":"https://api.github.com/users/ohemorange/orgs","repos_url":"https://api.github.com/users/ohemorange/repos","events_url":"https://api.github.com/users/ohemorange/events{/privacy}","received_events_url":"https://api.github.com/users/ohemorange/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T06:49:50Z","updated_at":"2018-04-17T06:49:50Z","author_association":"CONTRIBUTOR","body":"@lopugit, I don't see a named expression in that regex. Sounds like you have larger questions about setting up your config; I highly recommend posting on the community forums at [community.letsencrypt.org](https://community.letsencrypt.org) where a large group of friendly people will be able to quickly respond to your question."}}
{"actor":{"display_login":"ohemorange"}}