Initial commit.

This commit is contained in:
Drew Larson
2016-03-23 16:29:28 -06:00
commit b6ad0dd068
90 changed files with 2889 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
- name: restart nginx
service: name=nginx state=restarted
+12
View File
@@ -0,0 +1,12 @@
---
- name: Configure nginx to run proxypass {{ app_name }}
action: template src={{ group_names[0] }}/nginx-site.conf dest=/etc/nginx/sites-available/{{ app_domain_name }}
notify: restart nginx
tags:
- nginx
- name: Enable {{ app_name }} nginx config
action: file src=/etc/nginx/sites-available/{{ app_domain_name }} dest=/etc/nginx/sites-enabled/{{ app_domain_name }} state=link
notify: restart nginx
tags:
- nginx
@@ -0,0 +1,61 @@
server {
listen 80;
server_name www.{{ app_domain_name }};
# $scheme will get the http protocol
# and 301 is best practice for tablet, phone, desktop and seo
return 301 https://{{ app_domain_name }}$request_uri;
}
server {
listen 80;
server_name {{ app_domain_name }};
# $scheme will get the http protocol
# and 301 is best practice for tablet, phone, desktop and seo
return 301 https://{{ app_domain_name }}$request_uri;
}
server {
listen 443 ssl;
server_name {{ app_domain_name }};
ssl_certificate /etc/letsencrypt/live/{{ app_domain_name }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ app_domain_name }}/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root {{ app_dir }}/{{ app_name }};
}
location /media/ {
root {{ app_dir }}/{{ app_name }};
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 10;
proxy_read_timeout 10;
proxy_pass http://localhost:{{ app_port }}/;
}
}
server {
listen 4051;
server_name events.{{ app_domain_name }};
location /incoming/spikeEvent.php {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 10;
proxy_read_timeout 10;
proxy_pass http://localhost:{{ app_port }}/incoming/;
}
}
@@ -0,0 +1,31 @@
server {
listen 80;
server_name www.{{ app_domain_name }};
# $scheme will get the http protocol
# and 301 is best practice for tablet, phone, desktop and seo
return 301 $scheme://{{ app_domain_name }}$request_uri;
}
server {
listen 80;
server_name {{ app_domain_name }};
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root {{ app_dir }};
}
location /media/ {
root {{ app_dir }};
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 10;
proxy_read_timeout 10;
proxy_pass http://localhost:{{ app_port }}/;
}
}