diff --git a/roles/native-nginx/readme.md b/roles/native-nginx/readme.md new file mode 100644 index 00000000..2dc7faf2 --- /dev/null +++ b/roles/native-nginx/readme.md @@ -0,0 +1,4 @@ +# role native-nginx +## performance +- https://www.monitis.com/blog/6-best-practices-for-optimizing-your-nginx-performance/ +- https://www.nginx.com/blog/tuning-nginx/ diff --git a/roles/native-nginx/tasks/main.yml b/roles/native-nginx/tasks/main.yml index fa050e4a..476d79ad 100644 --- a/roles/native-nginx/tasks/main.yml +++ b/roles/native-nginx/tasks/main.yml @@ -10,7 +10,7 @@ mode: 0755 - name: create nginx config file - template: src=nginx.conf dest=/etc/nginx/nginx.conf + template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf notify: restart nginx - name: flush nginx service diff --git a/roles/native-nginx/templates/nginx.conf b/roles/native-nginx/templates/nginx.conf.j2 similarity index 59% rename from roles/native-nginx/templates/nginx.conf rename to roles/native-nginx/templates/nginx.conf.j2 index a7a36f0f..3bab0747 100644 --- a/roles/native-nginx/templates/nginx.conf +++ b/roles/native-nginx/templates/nginx.conf.j2 @@ -9,11 +9,14 @@ http { include mime.types; default_type text/html; - access_log syslog:server=unix:/dev/log; error_log syslog:server=unix:/dev/log; sendfile on; keepalive_timeout 65; gzip on; + gzip_proxied any; + gzip_types text/plain text/xml text/css application/x-javascript text/javascript application/xml+rss; + gzip_vary on; + gzip_disable "MSIE [1-6]\.(?!.*SV1)"; types_hash_max_size 4096; include conf.d/*.conf; }