How can I host two different sites on my Linode, one being served over HTTP and the other over HTTPS?

Linode Staff

I need to host 2 sites on the same server - 1 https and one http. Can you send me any links on how to setup using SNI? From what I have been reading I thought that SNI was just for a server with 2x SSL enabled sites - if that's not the case and it can solve the problem then perfect!

2 Replies


While I am not 100% familiar with all of the in's and out's of SNI, I am aware that it is primarily used for hosting multiple HTTPS websites on the same IP address.,_Server_Name_Indication_(SNI)_for_HTTPS

To achieve the configuration that you're looking for you should be able to just use ServerBlocks in Nginx or VirtualHosts in Apache and specify the particular Server_names and Root locations.

In an Nginx application you would need to edit your ServerBlock located at the directory below by default:


You would need to configure this fine to be similar to the one below:

 server {
     listen         80 default_server;
     listen         [::]:80 default_server;
     root           /var/www/;
     index          index.html;

 server {
     listen              443 ssl;
     listen          [::]:443 ssl;
     ssl_protocols          TLSv1 TLSv1.1 TLSv1.2;
     ssl_ciphers          HIGH:!aNULL:!MD5;
     root          /var/www/;
     index          index.html;

This should cause all requests directed to to connect to your web server over port 80 and serve the content in /var/www/ and all request directed to to connect to your web server over port 443 using the assigned SSL certificate and serve the content listed in /var/www/

You can view more information on Nginx and configuring Nginx server blocks in the documentation below:

The configuration on an Apache server is actually pretty similar but some of the verbiage is different. First and foremost Apache does not use Server Blocks it uses the VirtualHosts file. This file is usually located in the directory:


You would want to implement a configuration similar to the one below:

  <VirtualHost *:80>
      DocumentRoot      /var/www/
      ErrorLog      /var/www/
      CustomLog      /var/www/ combined

 <VirtualHost *:443>
      SSLEngine on
      SSLCipherSuite $sslcipherinfo
      SSLCertificateFile      /etc/ssl/
      SSLCertificateKeyFile   /etc/ssl/

      DocumentRoot    /var/www/
      ErrorLog        /var/www/
      CustomLog       /var/www/ combined


You can view more information on Apache and configuring VirtualHosts in the documentation below:

Feel free to let us know if you have any issues with the information in this post or any other questions.

Matt Watts
Linode Support Team

You should use HTTPS unless you have a really good reason not to.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct