diff --git a/deploy/deploy.yml b/deploy/deploy.yml index 7803732..1f70092 100644 --- a/deploy/deploy.yml +++ b/deploy/deploy.yml @@ -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 diff --git a/deploy/templates/nginx.j2 b/deploy/templates/nginx.j2 index 72d4fc0..ce40ac5 100644 --- a/deploy/templates/nginx.j2 +++ b/deploy/templates/nginx.j2 @@ -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; }