Need instruction to access both http and https

May 21, 2014 1k views
We want to know how to use both http and https for our website, and how to setup both http and https for only single url of our website. Thanks in advance
4 Answers
What webserver do you use? Apache or nginx?
Hi Jake,

Without know more details of your setup, it's hard to give exact advice. Generally, you'd just set up a new VirtualHost listening on port 443:


<VirtualHost *:443>
ServerName example.com
DocumentRoot /var/www/http
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
# etc...
</VirtualHost>

<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/http
# etc...
</VirtualHost>


If you could expand on your setup and use case, maybe we could come up with a more detailed answer.
This article should point you in the right direction to get started with SSL and nginx:

https://www.digitalocean.com/community/articles/how-to-create-a-ssl-certificate-on-nginx-for-ubuntu-14-04
Have another answer? Share your knowledge.