jdauphant / ansible-role-nginx

Ansible role to install and manage nginx configuration
655 stars 302 forks source link

chore: nginx temp directories permissions #221

Closed bdossantos closed 6 years ago

bdossantos commented 6 years ago

Hi !

This PR add a fix to ensure Proxy, body, fastcgi, uwsgi, scgi temp directories presence and writeable permissions. Those directories are needed as tmp location for large responses that doesn't fit in buffers.

bdossantos commented 6 years ago

I found a workaround that makes this PR more or less "obsolete".

I use nginx_http_params array to set my client_body_temp_path, proxy_cache_path, etc, eg:

 nginx_http_params:
  - sendfile 'on'
  - tcp_nopush 'on'
  - tcp_nodelay 'on'
  - keepalive_timeout '20'
  - access_log "{{ nginx_log_dir }}/access.log"
  - error_log "{{ nginx_log_dir }}/error.log"
  - server_names_hash_max_size 512
  - server_names_hash_bucket_size 128
  - server_tokens off
  - types_hash_max_size 2048
  - proxy_cache_path /dev/shm/cache levels=1:2 keys_zone=CACHE:1024m inactive=24h max_size=1024m
  - client_body_temp_path /dev/shm/client_body
  - fastcgi_temp_path /dev/shm/fastcgi
  - proxy_temp_path /dev/shm/proxy
jdauphant commented 6 years ago

:+1: Thanks for the research. It's better to keep it simple ;)