Fixes #141 adding template support and readme example

pull/142/head
Ryan Faircloth 6 years ago
parent 7aa2ea4779
commit c35ac60166
  1. 9
      README.md
  2. 11
      templates/vhost.j2

@ -30,6 +30,15 @@ A list of vhost definitions (server blocks) for Nginx virtual hosts. Each entry
state: "present"
template: "{{ nginx_vhost_template }}"
filename: "example.com.conf"
location:
- name: /proxyme
extra_parameters: |
proxy_pass_request_headers on;
proxy_set_header x-real-IP $remote_addr;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header host $host;
proxy_pass https://127.0.0.1:8000;
extra_parameters: |
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;

@ -24,6 +24,17 @@ server {
index {{ item.index | default('index.html index.htm') }};
{% if item.location is defined %}
{% for loc in item.location -%}
location {{ loc.name }} {
{{ loc.extra_parameters|indent(8) }}
}
{%- endfor %}
{% endif %}
{% if item.error_page is defined %}
error_page {{ item.error_page }};
{% endif %}