Reputation: 7072
I setup a new server. Before I change the nameservers of the domain to the new server, I would like to test if the SSL is correctly installed. Is there a possibility for this? I'm using Nginx.
Upvotes: 0
Views: 426
Reputation: 5027
Yes. you can test the SSL before changing the domain record.
assume you want to test SSL with domain www.example.com
, Nginx config should like following:
server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate your-ssl-crt.crt;
ssl_certificate_key your-private-key.key;
...
}
and assume your server IP is 192.0.2.78
. by updating a file named hosts
at /etc/hosts
(change the file on your client, not the server)
, you will be able to browse www.example.com
which served by 192.0.2.78
.
You need to use root permission to change the host file by command sudo vim /etc/hosts
, add a new line:
192.0.2.78 www.example.com
Now you can test whether your SSL work via https://www.example.com
Upvotes: 2