{"id":14018,"date":"2020-02-08T15:17:14","date_gmt":"2020-02-08T14:17:14","guid":{"rendered":"https:\/\/www.datanovia.com\/en\/?post_type=dt_lessons&#038;p=14018"},"modified":"2020-02-15T19:45:54","modified_gmt":"2020-02-15T18:45:54","slug":"how-host-multiple-https-websites-on-one-server","status":"publish","type":"dt_lessons","link":"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/","title":{"rendered":"How to Host Multiple HTTPS Websites on One Server"},"content":{"rendered":"<div id=\"rdoc\">\n<div id=\"TOC\">\n<ul>\n<li><a href=\"#prerequisites\">Prerequisites<\/a><\/li>\n<li><a href=\"#step-1-create-websites-directories\">Step 1: Create websites directories<\/a><\/li>\n<li><a href=\"#step-2-download-a-template\">Step 2: Download a template<\/a><\/li>\n<li><a href=\"#step-3-inspect-the-project-structure-and-configuration-files\">Step 3: Inspect the project structure and configuration files<\/a>\n<ul>\n<li><a href=\"#project-structure\">Project Structure<\/a><\/li>\n<li><a href=\"#inspect-the-docker-compose.yml-configuration-file\">Inspect the docker-compose.yml configuration file<\/a><\/li>\n<li><a href=\"#update-nginx.tmpl-nginx-configuration-file-template\">Update nginx.tmpl: Nginx configuration file template<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#step-4-run-the-nginx-reverse-proxy\">Step 4: Run the nginx reverse proxy<\/a><\/li>\n<li><a href=\"#step-5-link-a-website-to-the-running-nginx-proxy\">Step 5: Link a website to the running nginx-proxy<\/a><\/li>\n<li><a href=\"#frequently-asked-question\">Frequently asked question<\/a>\n<ul>\n<li><a href=\"#how-to-redirect-from-http-non-www-to-https-www\">How to redirect from http non-www to https www?<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#references\">References<\/a><\/li>\n<\/ul>\n<\/div>\n<p>This article provides a template to easily configure the deployment of <strong>multiple websites on one server<\/strong> IP or on <em>one droplet from digitalocean<\/em>. Reverse-proxy, nginx configuration files and SSL certificate are created automatically for each website running in a Docker container.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/digitalocean-config-and-multiple-websites\/images\/host-multiple-websites-on-one-server.jpeg\" alt=\"Multiple websites one one server\" \/><\/p>\n<p>Contents:<\/p>\n<div id=\"TOC\">\n<ul>\n<li><a href=\"#prerequisites\">Prerequisites<\/a><\/li>\n<li><a href=\"#step-1-create-websites-directories\">Step 1: Create websites directories<\/a><\/li>\n<li><a href=\"#step-2-download-a-template\">Step 2: Download a template<\/a><\/li>\n<li><a href=\"#step-3-inspect-the-project-structure-and-configuration-files\">Step 3: Inspect the project structure and configuration files<\/a>\n<ul>\n<li><a href=\"#project-structure\">Project Structure<\/a><\/li>\n<li><a href=\"#inspect-the-docker-compose.yml-configuration-file\">Inspect the docker-compose.yml configuration file<\/a><\/li>\n<li><a href=\"#update-nginx.tmpl-nginx-configuration-file-template\">Update nginx.tmpl: Nginx configuration file template<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#step-4-run-the-nginx-reverse-proxy\">Step 4: Run the nginx reverse proxy<\/a><\/li>\n<li><a href=\"#step-5-link-a-website-to-the-running-nginx-proxy\">Step 5: Link a website to the running nginx-proxy<\/a><\/li>\n<li><a href=\"#frequently-asked-question\">Frequently asked question<\/a>\n<ul>\n<li><a href=\"#how-to-redirect-from-http-non-www-to-https-www\">How to redirect from http non-www to https www?<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#references\">References<\/a><\/li>\n<\/ul>\n<\/div>\n<div id=\"prerequisites\" class=\"section level2\">\n<h2>Prerequisites<\/h2>\n<p>Required tools and create domain names<\/p>\n<ul>\n<li>Git, docker and docker-compose are installed on your server<\/li>\n<li>Several websites run inside Docker containers on a single server. (Each one could either be a static files server, or WordPress running on Apache, etc.<\/li>\n<li>The domain name for each website is configured to point to the IP of the server. Your host must be publicly reachable on both port <code>80<\/code> and <code>443<\/code>. <a href=\"\/?p=14008\">Check your firewall rules to make sure that these ports are open<\/a>.<\/li>\n<li><a href=\"\/?p=14017\">Create a website directory and set up proper permissions<\/a>. In this tutorial, we\u2019ll assume that the web directory is at <code>\/srv\/www<\/code><\/li>\n<\/ul>\n<\/div>\n<div id=\"step-1-create-websites-directories\" class=\"section level2\">\n<h2>Step 1: Create websites directories<\/h2>\n<p>Read more: <a href=\"\/?p=14017\">Create a website directory and set up proper permissions<\/a><\/p>\n<pre class=\"bash\"><code># 0. settings\r\nweb_dir=\/srv\/www\r\nmyusername=kassambara\r\n# 1. Create the website directory\r\nsudo mkdir -p $web_dir\r\n# 2. set your user as the owner\r\nsudo chown -R $myusername $web_dir\r\n# 3. set the web server as the group owner\r\nsudo chgrp -R www-data $web_dir\r\n# 4. 755 permissions for everything\r\nsudo chmod -R 755 $web_dir\r\n# 5. New files and folders inherit \r\n# group ownership from the parent folder\r\nchmod g+s $web_dir<\/code><\/pre>\n<\/div>\n<div id=\"step-2-download-a-template\" class=\"section level2\">\n<h2>Step 2: Download a template<\/h2>\n<p>Download a template into your website directories www<\/p>\n<pre class=\"bash\"><code>web_dir=\/srv\/www\r\ngit clone https:\/\/github.com\/kassambara\/nginx-multiple-https-websites-on-one-server $web_dir<\/code><\/pre>\n<\/div>\n<div id=\"step-3-inspect-the-project-structure-and-configuration-files\" class=\"section level2\">\n<h2>Step 3: Inspect the project structure and configuration files<\/h2>\n<div id=\"project-structure\" class=\"section level3\">\n<h3>Project Structure<\/h3>\n<pre><code>www\r\n\u251c\u2500\u2500 README.Rmd\r\n\u251c\u2500\u2500 README.md\r\n\u251c\u2500\u2500 nginx-proxy\r\n\u2502   \u251c\u2500\u2500 certs\r\n\u2502   \u251c\u2500\u2500 conf.d\r\n\u2502   \u251c\u2500\u2500 docker-compose.yml\r\n\u2502   \u251c\u2500\u2500 html\r\n\u2502   \u251c\u2500\u2500 nginx.tmpl\r\n\u2502   \u2514\u2500\u2500 vhost.d\r\n\u251c\u2500\u2500 your-website-one.com\r\n\u2502   \u251c\u2500\u2500 docker-compose.yml\r\n\u2502   \u2514\u2500\u2500 index.html\r\n\u2514\u2500\u2500 your-website-two.com\r\n    \u251c\u2500\u2500 docker-compose.yml\r\n    \u2514\u2500\u2500 index.html<\/code><\/pre>\n<p>Inside <code>\/nginx-proxy<\/code>, there are four empty directories: <code>conf.d<\/code>, <code>vhost.d<\/code>, <code>html<\/code> and <code>certs<\/code>. These are used to store the nginx and the Let\u2019s Encrypt configuration files.<\/p>\n<\/div>\n<div id=\"inspect-the-docker-compose.yml-configuration-file\" class=\"section level3\">\n<h3>Inspect the docker-compose.yml configuration file<\/h3>\n<p>Inside <code>\/nginx-proxy\/<\/code>, there is a <a href=\"https:\/\/github.com\/kassambara\/nginx-multiple-https-websites-on-one-server\/blob\/master\/nginx-proxy\/docker-compose.yml\">docker-compose.yml<\/a> file with this content:<\/p>\n<pre class=\"yaml\"><code>version: '3.6'\r\nservices:\r\n  nginx:\r\n    image: nginx\r\n    labels:\r\n      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: \"true\"\r\n    container_name: nginx\r\n    restart: unless-stopped\r\n    ports:\r\n      - \"80:80\"\r\n      - \"443:443\"\r\n    volumes:\r\n      - .\/conf.d:\/etc\/nginx\/conf.d\r\n      - .\/vhost.d:\/etc\/nginx\/vhost.d\r\n      - .\/html:\/usr\/share\/nginx\/html\r\n      - .\/certs:\/etc\/nginx\/certs:ro\r\n\r\n  nginx-gen:\r\n    image: jwilder\/docker-gen\r\n    command: -notify-sighup nginx -watch -wait 5s:30s \/etc\/docker-gen\/templates\/nginx.tmpl \/etc\/nginx\/conf.d\/default.conf\r\n    container_name: nginx-gen\r\n    restart: unless-stopped\r\n    volumes:\r\n      - .\/conf.d:\/etc\/nginx\/conf.d\r\n      - .\/vhost.d:\/etc\/nginx\/vhost.d\r\n      - .\/html:\/usr\/share\/nginx\/html\r\n      - .\/certs:\/etc\/nginx\/certs:ro\r\n      - \/var\/run\/docker.sock:\/tmp\/docker.sock:ro\r\n      - .\/nginx.tmpl:\/etc\/docker-gen\/templates\/nginx.tmpl:ro\r\n\r\n  nginx-letsencrypt:\r\n    image: jrcs\/letsencrypt-nginx-proxy-companion\r\n    container_name: nginx-letsencrypt\r\n    restart: unless-stopped\r\n    volumes:\r\n      - .\/conf.d:\/etc\/nginx\/conf.d\r\n      - .\/vhost.d:\/etc\/nginx\/vhost.d\r\n      - .\/html:\/usr\/share\/nginx\/html\r\n      - .\/certs:\/etc\/nginx\/certs:rw\r\n      - \/var\/run\/docker.sock:\/var\/run\/docker.sock:ro\r\n    environment:\r\n      NGINX_DOCKER_GEN_CONTAINER: \"nginx-gen\"\r\n      NGINX_PROXY_CONTAINER: \"nginx\"\r\nnetworks:\r\n  default:\r\n    external:\r\n      name: nginx-proxy<\/code><\/pre>\n<p>This will launch three services:<\/p>\n<ul>\n<li><code>nginx<\/code>: the nginx-reverse proxy, uses the default nginx image. The label is needed so that the letsencrypt container knows which nginx proxy container to use.<\/li>\n<li><code>nginx-gen<\/code>: uses the jwilder\/docker-gen image. Its command instruction will render a nginx configuration (based on nginx.tmpl) for each website \/ container added to the network.<\/li>\n<li><code>nginx-letsencrypt<\/code>: generates and renew the HTTPS certificates.<\/li>\n<\/ul>\n<p>All these services are bound to the <code>nginx-proxy<\/code> network.<\/p>\n<\/div>\n<div id=\"update-nginx.tmpl-nginx-configuration-file-template\" class=\"section level3\">\n<h3>Update nginx.tmpl: Nginx configuration file template<\/h3>\n<p>Inside <code>\/nginx-proxy\/<\/code>, there is a <a href=\"https:\/\/raw.githubusercontent.com\/jwilder\/nginx-proxy\/master\/nginx.tmpl\">nginx.tmpl<\/a> file. This is the used by the <code>nginx-gen<\/code> container to create the nginx configuration file for each website \/ container added to the network.<\/p>\n<p>Download the latest updated version from <a href=\"https:\/\/raw.githubusercontent.com\/jwilder\/nginx-proxy\/master\/nginx.tmpl\">Github here<\/a>:<\/p>\n<pre class=\"bash\"><code># Remove old version\r\nrm -rf $web_dir\/nginx-proxy\/nginx.tmpl\r\n# Download new version\r\ncurl -s https:\/\/raw.githubusercontent.com\/jwilder\/nginx-proxy\/master\/nginx.tmpl&gt; $web_dir\/nginx-proxy\/nginx.tmpl<\/code><\/pre>\n<\/div>\n<\/div>\n<div id=\"step-4-run-the-nginx-reverse-proxy\" class=\"section level2\">\n<h2>Step 4: Run the nginx reverse proxy<\/h2>\n<pre class=\"bash\"><code># 1. Create the docker network\r\ndocker network create nginx-proxy\r\n\r\n# 2. Create the reverse proxy with the \r\n# nginx, nginx-gen and nginx-letsencrypt containers\r\ncd \/srv\/www\/nginx-proxy\/\r\ndocker-compose up -d<\/code><\/pre>\n<\/div>\n<div id=\"step-5-link-a-website-to-the-running-nginx-proxy\" class=\"section level2\">\n<h2>Step 5: Link a website to the running nginx-proxy<\/h2>\n<p>The <code>docker-compose.yml<\/code> file of the website, you want to link, should include the following instructions provided in the template available in the folder <code>your-website-one.com<\/code> (<strong>not<\/strong> the one from nginx-proxy above). The content of the template looks like this:<\/p>\n<pre class=\"yaml\"><code>version: '3.6'\r\n\r\nservices:\r\n  my-app:\r\n    image: nginx\r\n    restart: always\r\n    environment:\r\n      # NGINX-PROXY ENVIRONMENT VARIABLES: UPDATE ME\r\n      - VIRTUAL_HOST=your-website-one.com \r\n      - VIRTUAL_PORT=80\r\n      - LETSENCRYPT_HOST=your-website-one.com \r\n      - LETSENCRYPT_EMAIL=your.email@domain.com\r\n      # END NGINX-PROXY ENVIRONMENT VARIABLES\r\n    expose:\r\n      - 80\r\n\r\nnetworks:\r\n  default:\r\n    external:\r\n      name: nginx-proxy<\/code><\/pre>\n<ol style=\"list-style-type: decimal;\">\n<li><strong>Environment variables<\/strong>:\n<ul>\n<li><code>VIRTUAL_HOST<\/code>: your domain name, used in the nginx configuration.<\/li>\n<li><code>VIRTUAL_PORT<\/code>: (optional) the port your website is listening to (default to 80).<\/li>\n<li><code>LETSENCRYPT_HOST<\/code>: your domain name, used in the Let\u2019s Encrypt configuration.<\/li>\n<li><code>LETSENCRYPT_EMAIL<\/code>: your email, used in the Let\u2019s Encrypt configuration.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Ports<\/strong>:\n<ul>\n<li>the exposed port (here 80) should be the same as the <code>VIRTUAL_PORT<\/code> above.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Network<\/strong>:\n<ul>\n<li>your website container should be linked to the external docker network named <code>nginx-proxy<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>Once the update of the <code>docker-compose.yml<\/code> file is done, you can <strong>start the website with<\/strong>:<\/p>\n<pre class=\"bash\"><code>cd \/srv\/www\/your-website-one.com\r\ndocker-compose up -d<\/code><\/pre>\n<div class=\"success\">\n<p>The website is automatically detected by the reverse proxy, has a HTTPS certificate and is visible at <a class=\"uri\" href=\"https:\/\/your-website-one.com\">https:\/\/your-website-one.com<\/a>.<\/p>\n<p>You can repeat this last step for any other container you want to proxy<\/p>\n<\/div>\n<\/div>\n<div id=\"frequently-asked-question\" class=\"section level2\">\n<h2>Frequently asked question<\/h2>\n<div id=\"how-to-redirect-from-http-non-www-to-https-www\" class=\"section level3\">\n<h3>How to redirect from http non-www to https www?<\/h3>\n<p>If you have control of the DNS record, the best practice is to take care it with an ALIAS ( or CNAME). <a href=\"https:\/\/github.com\/jwilder\/nginx-proxy\/issues\/1204\">See discussion<\/a>.<\/p>\n<p><strong>Solution 1. Use redirect container<\/strong>. Catch all http redirect, useful for http -&gt; https redirects. Insanely fast and small! Based on alpine and nginx. Source: <a href=\"https:\/\/github.com\/cusspvz\/redirect.docker\">cusspvz\/redirect.docker<\/a><\/p>\n<pre class=\"yaml\"><code>version: '3.6'\r\n\r\nservices:\r\n  www.omicstudio.com:\r\n    image: nginx\r\n    restart: always\r\n    volumes:\r\n      - \".\/:\/usr\/share\/nginx\/html\"\r\n    environment:\r\n      - VIRTUAL_HOST=www.omicstudio.com\r\n      - VIRTUAL_PORT=80\r\n      - LETSENCRYPT_HOST=www.omicstudio.com\r\n      - LETSENCRYPT_EMAIL=alboukadel.kassambara@gmail.com\r\n\r\n  # redirect omicstudio.com to www.omicstudio.com\r\n  omicstudio.com:\r\n    image: cusspvz\/redirect\r\n    restart: always\r\n    environment:\r\n      - VIRTUAL_HOST=omicstudio.com\r\n      - VIRTUAL_PORT=80\r\n      - HTTPS_METHOD=noredirect\r\n      - LETSENCRYPT_HOST=omicstudio.com\r\n      - REDIRECT=https:\/\/www.omicstudio.com\r\n      # See available redirect parameters: https:\/\/github.com\/cusspvz\/redirect.docker\r\n      - WORKER_CONNECTIONS=1024\r\n      \r\nnetworks:\r\n  default:\r\n    external:\r\n      name: nginx-proxy<\/code><\/pre>\n<p><strong>Solution 2<\/strong>. see this merge request: <a href=\"https:\/\/github.com\/jwilder\/nginx-proxy\/pull\/1369\">Added VIRTUAL_HOST_ALIAS support<\/a><\/p>\n<\/div>\n<\/div>\n<div id=\"references\" class=\"section level2\">\n<h2>References<\/h2>\n<ul>\n<li><a href=\"https:\/\/medium.com\/@francoisromain\/host-multiple-websites-with-https-inside-docker-containers-on-a-single-server-18467484ab95\">Host multiple websites with HTTPS on a single server<\/a><\/li>\n<li><a href=\"https:\/\/olex.biz\/2019\/09\/hosting-with-docker-nginx-reverse-proxy-letsencrypt\/\">Hosting multiple sites or applications using Docker and NGINX reverse proxy with Letsencrypt SSL<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/jwilder\/nginx-proxy\">Automated nginx proxy for Docker containers using docker-gen<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/JrCs\/docker-letsencrypt-nginx-proxy-companion\">LetsEncrypt companion container for nginx-proxy<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<p><!--end rdoc--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Provides a template to easily configure the deployment of multiple websites on one server IP or on one droplet from digitalocean. Reverse-proxy, nginx configuration files and SSL certificate are created automatically for each website running in a Docker container<\/p>\n","protected":false},"author":1,"featured_media":9109,"parent":0,"menu_order":20,"comment_status":"open","ping_status":"closed","template":"","class_list":["post-14018","dt_lessons","type-dt_lessons","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Host Multiple HTTPS Websites on One Server - Datanovia<\/title>\n<meta name=\"description\" content=\"Provides a template to easily configure the deployment of multiple websites on one server IP or on one droplet from digitalocean. Reverse-proxy, nginx configuration files and SSL certificate are created automatically for each website running in a Docker container\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Host Multiple HTTPS Websites on One Server - Datanovia\" \/>\n<meta property=\"og:description\" content=\"Provides a template to easily configure the deployment of multiple websites on one server IP or on one droplet from digitalocean. Reverse-proxy, nginx configuration files and SSL certificate are created automatically for each website running in a Docker container\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Datanovia\" \/>\n<meta property=\"article:modified_time\" content=\"2020-02-15T18:45:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/Sterne.royale.9.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/\",\"name\":\"How to Host Multiple HTTPS Websites on One Server - Datanovia\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/Sterne.royale.9.jpg\",\"datePublished\":\"2020-02-08T14:17:14+00:00\",\"dateModified\":\"2020-02-15T18:45:54+00:00\",\"description\":\"Provides a template to easily configure the deployment of multiple websites on one server IP or on one droplet from digitalocean. Reverse-proxy, nginx configuration files and SSL certificate are created automatically for each website running in a Docker container\",\"breadcrumb\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/#primaryimage\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/Sterne.royale.9.jpg\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/Sterne.royale.9.jpg\",\"width\":1024,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.datanovia.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lessons\",\"item\":\"https:\/\/www.datanovia.com\/en\/lessons\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Host Multiple HTTPS Websites on One Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\",\"url\":\"https:\/\/www.datanovia.com\/en\/\",\"name\":\"Datanovia\",\"description\":\"Data Mining and Statistics for Decision Support\",\"publisher\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.datanovia.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\",\"name\":\"Datanovia\",\"url\":\"https:\/\/www.datanovia.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png\",\"width\":98,\"height\":99,\"caption\":\"Datanovia\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Host Multiple HTTPS Websites on One Server - Datanovia","description":"Provides a template to easily configure the deployment of multiple websites on one server IP or on one droplet from digitalocean. Reverse-proxy, nginx configuration files and SSL certificate are created automatically for each website running in a Docker container","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/","og_locale":"en_US","og_type":"article","og_title":"How to Host Multiple HTTPS Websites on One Server - Datanovia","og_description":"Provides a template to easily configure the deployment of multiple websites on one server IP or on one droplet from digitalocean. Reverse-proxy, nginx configuration files and SSL certificate are created automatically for each website running in a Docker container","og_url":"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/","og_site_name":"Datanovia","article_modified_time":"2020-02-15T18:45:54+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/Sterne.royale.9.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/","url":"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/","name":"How to Host Multiple HTTPS Websites on One Server - Datanovia","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/#primaryimage"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/Sterne.royale.9.jpg","datePublished":"2020-02-08T14:17:14+00:00","dateModified":"2020-02-15T18:45:54+00:00","description":"Provides a template to easily configure the deployment of multiple websites on one server IP or on one droplet from digitalocean. Reverse-proxy, nginx configuration files and SSL certificate are created automatically for each website running in a Docker container","breadcrumb":{"@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/#primaryimage","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/Sterne.royale.9.jpg","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/Sterne.royale.9.jpg","width":1024,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-host-multiple-https-websites-on-one-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.datanovia.com\/en\/"},{"@type":"ListItem","position":2,"name":"Lessons","item":"https:\/\/www.datanovia.com\/en\/lessons\/"},{"@type":"ListItem","position":3,"name":"How to Host Multiple HTTPS Websites on One Server"}]},{"@type":"WebSite","@id":"https:\/\/www.datanovia.com\/en\/#website","url":"https:\/\/www.datanovia.com\/en\/","name":"Datanovia","description":"Data Mining and Statistics for Decision Support","publisher":{"@id":"https:\/\/www.datanovia.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.datanovia.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.datanovia.com\/en\/#organization","name":"Datanovia","url":"https:\/\/www.datanovia.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png","width":98,"height":99,"caption":"Datanovia"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/"}}]}},"multi-rating":{"mr_rating_results":[]},"_links":{"self":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons\/14018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons"}],"about":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/types\/dt_lessons"}],"author":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/comments?post=14018"}],"version-history":[{"count":1,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons\/14018\/revisions"}],"predecessor-version":[{"id":14033,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons\/14018\/revisions\/14033"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media\/9109"}],"wp:attachment":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media?parent=14018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}