From 8707638c8a3de9acc12194dec83055c87cd5c8e8 Mon Sep 17 00:00:00 2001 From: AyanChoudhary Date: Thu, 2 Jan 2020 17:58:14 +0530 Subject: [PATCH] feat:add vhosts --- config/backend.sdslabs.conf | 12 ++++++++++++ config/portfolio.sdslabs.conf | 27 +++++++++++++++++++++++++++ settings/common.py | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 config/backend.sdslabs.conf create mode 100644 config/portfolio.sdslabs.conf diff --git a/config/backend.sdslabs.conf b/config/backend.sdslabs.conf new file mode 100644 index 0000000..81a2485 --- /dev/null +++ b/config/backend.sdslabs.conf @@ -0,0 +1,12 @@ + + # ProxyPreserveHost On + # Servers to proxy the connection, or; + # List of application servers: + # Usage: + # ProxyPass / http://[IP Addr.]:[port]/ + # ProxyPassReverse / http://[IP Addr.]:[port]/ + # Example: + ProxyPass / http://127.0.0.1:8000/ + ProxyPassReverse / http://127.0.0.1:8000/ + ServerName portfolio-backend.sdslabs.co + diff --git a/config/portfolio.sdslabs.conf b/config/portfolio.sdslabs.conf new file mode 100644 index 0000000..38c185a --- /dev/null +++ b/config/portfolio.sdslabs.conf @@ -0,0 +1,27 @@ + + # ProxyPreserveHost On + # Servers to proxy the connection, or; + # List of application servers: + # Usage: + # ProxyPass / http://[IP Addr.]:[port]/ + # ProxyPassReverse / http://[IP Addr.]:[port]/ + # Example: + ProxyPass / http://127.0.0.1:8080/ + ProxyPassReverse / http://127.0.0.1:8080/ + ServerName portfolio-beta.sdslabs.co + DocumentRoot /home/d3mon/Projects/portfolio/frontend/src + + Options -Indexes -MultiViews + Allowoverride all + Require all granted + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} -f [OR] + RewriteCond %{REQUEST_FILENAME} -d + RewriteRule ^(.*)$ - [QSA,L] + RewriteRule ^api/(.*)$ http://localhost:8000/api/$1 [END] + RewriteRule ^(.*)$ http://localhost:8080/$1 [P] + + ErrorLog ${APACHE_LOG_DIR}/portfolio.error.log + LogLevel warn + CustomLog ${APACHE_LOG_DIR}/portfolio.access.log combined + diff --git a/settings/common.py b/settings/common.py index 41bd589..435aff1 100644 --- a/settings/common.py +++ b/settings/common.py @@ -30,7 +30,7 @@ CORS_ORIGIN_ALLOW_ALL = DEBUG -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ["*"] # Application definition