Skip to content

Instantly share code, notes, and snippets.

@JonathanThorpe
Last active October 26, 2016 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonathanThorpe/c5b5ad5853c3465e1bbc9765030a4b5d to your computer and use it in GitHub Desktop.
Save JonathanThorpe/c5b5ad5853c3465e1bbc9765030a4b5d to your computer and use it in GitHub Desktop.
#init.sls
{% for webapp, data in salt['pillar.get']('web_apps', {}).iteritems() %}
/etc/nginx/sites-available/{{webapp}}.conf:
file.managed:
- user: root
- group: root
- mode: 644
- makedirs: True
- template: jinja
- source: salt://nginx/files/site.conf
- context:
webapp: {{webapp}}
data: {{data}}
{% endfor %}
#Pillar SLS:
web_apps:
sitename.xyz:
enabled: True
https: True
http: True
server_name: sitename.xyz
nginx_redirect_php_to_apache: True
index: index.php index.html
root: /home/www/virtual/sitename.xyz
extra_config: |
rewrite "^/([a-zA-Z0-9_-{16}]+)$(.*)" /display.php?mid=$1 permanent;
include acl_staging_sites;
access_log: /var/log/nginx/sitename.xyz.access.log
#nginx/files/site.conf
{{data.extra_config | default('')}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment