change nginx config to be just a location block

This commit is contained in:
Riku Rouvila
2015-01-14 19:13:55 +02:00
parent 0c7afd6ffc
commit c117464987
2 changed files with 9 additions and 22 deletions

View File

@@ -37,20 +37,13 @@
remote_user: "{{ service_user }}"
template: >
src=templates/nginx.j2
dest="/etc/nginx/sites-available/{{ public_hostname }}"
dest="/etc/nginx/sites-available/koodiklinikka/{{ public_hostname }}"
mode=664
notify: restart nginx
- name: Enable nginx vhost
remote_user: "{{ service_user }}"
file: >
state=link
src=/etc/nginx/sites-available/{{ public_hostname }}
dest=/etc/nginx/sites-enabled/{{ public_hostname }}
notify: restart nginx
handlers:
- name: restart nginx
sudo: true
remote_user: "{{ service_user }}"
service: >
name=nginx

View File

@@ -1,15 +1,9 @@
server {
listen 80;
server_name {{ public_hostname }};
location / {
root {{ projects_path }}/public;
location / {
try_files $uri /index.html;
gzip_static on;
gzip_http_version 1.1;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;
}
try_files $uri /index.html;
gzip_static on;
gzip_http_version 1.1;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;
}