From b227794489b5de603f464257cb1d161457564b29 Mon Sep 17 00:00:00 2001 From: Ivan Grynenko Date: Sat, 11 Jun 2016 11:31:15 +1000 Subject: [PATCH] Added vhost/server variables to nginx, activated gzip. --- lemp-rhel7/group_vars/all.yml | 10 +++++----- .../roles/ansible-role-nginx/templates/nginx.conf.j2 | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lemp-rhel7/group_vars/all.yml b/lemp-rhel7/group_vars/all.yml index 4e0b376..09ef919 100644 --- a/lemp-rhel7/group_vars/all.yml +++ b/lemp-rhel7/group_vars/all.yml @@ -62,9 +62,9 @@ php_packages: # Nginx vhosts configuration nginx_vhosts: - - listen: "80 default_server" - server_name: "example.com www.example.com" - root: "/var/www/html/example.com" + - listen: "{{ nginx_port }} default_server" + server_name: "{{ server_hostname }} www.{{ server_hostname }}" + root: "/var/www/html/{{ server_hostname }}" open_file_cache: "max=2000 inactive=120s" open_file_cache_valid: "240s" open_file_cache_min_uses: "5" @@ -73,8 +73,8 @@ nginx_vhosts: client_body_timeout: "60" index: "index.php index.html index.htm" error_page: "403 =404" - access_log: "/var/log/nginx/example_access.log" - error_log: "/var/log/nginx/example_error.log" + access_log: "/var/log/nginx/{{ server_hostname }}_access.log" + error_log: "/var/log/nginx/{{ server_hostname }}_error.log" extra_parameters: | location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; diff --git a/lemp-rhel7/roles/ansible-role-nginx/templates/nginx.conf.j2 b/lemp-rhel7/roles/ansible-role-nginx/templates/nginx.conf.j2 index e9499e7..86eda73 100755 --- a/lemp-rhel7/roles/ansible-role-nginx/templates/nginx.conf.j2 +++ b/lemp-rhel7/roles/ansible-role-nginx/templates/nginx.conf.j2 @@ -35,7 +35,7 @@ http { keepalive_timeout {{ nginx_keepalive_timeout }}; keepalive_requests {{ nginx_keepalive_requests }}; - #gzip on; + gzip on; {% if nginx_proxy_cache_path %} proxy_cache_path {{ nginx_proxy_cache_path }};