Skip to content

Commit

Permalink
Merge pull request #31 from syphernl/feature/proxy_support
Browse files Browse the repository at this point in the history
Proxy vhost support
  • Loading branch information
eXistenZNL committed Sep 15, 2016
2 parents 1ff1d3d + b245f2e commit 98d362f
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .salt/pillar/vanilla-apache/overlay.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ vhosting:
server:
webserver: apache
webserver_edition: vanilla

# Apache
apache:
modules_enabled:
- ssl
- rewrite
- proxy
- proxy_http
8 changes: 8 additions & 0 deletions .salt/pillar/zendserver-apache/overlay.sls
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ zendserver:
# Which webserver to use, can either be apache or nginx
webserver: apache
bootstrap: False

# Apache
apache:
modules_enabled:
- ssl
- rewrite
- proxy
- proxy_http
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ but there is more…

> **note**
>
> This formula has **only been tested on Ubuntu 14.04**.
> This formula has **only been tested on Ubuntu 14.04/16.04**.
>
> : It will most likely not work on other platforms due to hardcoded
> package names and Ubuntu-specific commands.
Expand Down
9 changes: 8 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ The following keys can be defined:
**redirect\_to**

> A string which will - if set - redirect the domain to the given URL
> and uses the `redirect` vhost.
> and uses the `redirect` vhost template.
> This may be used in conjunction with `ssl`
**proxy\_pass**

> A string which will - if set - setup the webserver to proxy the domain to
> the given URL and uses the `proxy` vhost template.
> This may be used in conjunction with `ssl`
Expand Down
4 changes: 4 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ vhosting:
# This is a 'redirect vhost' which is just sending traffic to a different domain. Its vhost is very simple
redirect_to: 'http://www.example.com'

proxyme.com:
# This is a 'proxy vhost' which is just sending traffic to a different domain but masks the destination
proxy_pass: 'http://www.example.com'

#secured-site.com:
# # This vhost follows the defaults but does have forced SSL
# ssl:
Expand Down
3 changes: 3 additions & 0 deletions vhosting/resources/vhost.sls
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
{%- if 'redirect_to' in params %}
# Redirect vhost, no need for directory structure etc
{%- set template_file = params.get('template_file', vhost_template_path ~ '/redirect.conf.jinja') %}
{%- elif 'proxy_pass' in params %}
# Proxy vhost, no need for directory structure etc
{%- set template_file = params.get('template_file', vhost_template_path ~ '/proxy.conf.jinja') %}
{%- else %}
# Normal vhost, required folders
{%- set template_file = params.get('template_file', vhost_template_path ~ '/default.conf.jinja') %}
Expand Down

0 comments on commit 98d362f

Please sign in to comment.