added salt scripts back

This commit is contained in:
Matthew 2013-12-02 10:02:53 -06:00
parent 36cf728862
commit 810845441c
15 changed files with 339 additions and 0 deletions

15
srv/salt/nginx/init.sls Normal file
View file

@ -0,0 +1,15 @@
nginx:
pkg:
- installed
service.running:
- enable: True
- reload: True
- require:
- pkg: nginx
- watch:
- file: /etc/nginx/conf.d/realms.conf
/etc/nginx/conf.d/realms.conf:
file.managed:
- template: jinja
- source: salt://nginx/nginx.conf

71
srv/salt/nginx/nginx.conf Normal file
View file

@ -0,0 +1,71 @@
{% set root = '/home/deploy/realms/realms' %}
{% set ssl_certificate = False %}
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
upstream web {
fair;
server 127.0.0.1:10000;
}
server {
listen 80;
# Allow file uploads
client_max_body_size 50M;
location ^~ /static/ {
root {{ root }};
expires max;
}
location = /favicon.ico {
rewrite (.*) /static/favicon.ico;
}
location = /robots.txt {
rewrite (.*) /static/robots.txt;
}
location / {
proxy_pass_header Server;
proxy_redirect off;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $http_host;
proxy_pass http://web;
error_page 502 = /maintenance.html;
}
location /maintenance.html {
root {{ root }}/templates/;
add_header Cache-Control private;
expires epoch;
}
}
{% if ssl_certificate %}
server {
listen 443;
ssl on;
ssl_certificate {{ ssl_certificate }};
ssl_certificate_key {{ ssl_certificate_key }};
location ^~ /static/ {
root {{ root }};
expires max;
}
location / {
proxy_pass_header Server;
proxy_redirect off;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $http_host;
proxy_pass http://web;
error_page 502 = /maintenance.html;
}
}
{% endif %}