Saturday, May 27, 2017

[SSL][Resolved] Cannot find a VirtualHost matching domain example.com.

Error message

Cannot find a VirtualHost matching domain example.com. In order for Certbot to correctly perform the challenge please add a corresponding server_name directive to your nginx configuration: https://nginx.org/en/docs/http/server_names.html

if you're make sure you have:
1) created sites-available directory 
mkdir /etc/nginx/sites-available
2) Added these 2 lines to your /etc/nginx/nginx.conf
include /etc/nginx/sites-enabled/*.conf;
server_names_hash_bucket_size 64;
Don't forget to create a symbolic link between sites-available and sites-enabled, use the following code:
ln -s /etc/nginx/sites-available/yoursite.com.conf /etc/nginx/sites-enabled/yoursite.com.conf

Reference

https://www.unlimitedwebhosting.co.uk/blog/vps-hosting/setup-nginx-centos-6-vps-server/

No comments :

Post a Comment