fastcgi_pass_fpm.j2 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {% if ansible_prolog -%}
  2. {% from 'templates/ansible/prolog.j2' import prolog with context %}
  3. {{ prolog() }}
  4. {% endif -%}
  5. #
  6. # fastcgi configuration for Nginx and PHP-FPM
  7. #
  8. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  9. fastcgi_param PATH_INFO $fastcgi_path_info;
  10. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  11. fastcgi_param QUERY_STRING $query_string;
  12. fastcgi_param REQUEST_METHOD $request_method;
  13. fastcgi_param CONTENT_TYPE $content_type;
  14. fastcgi_param CONTENT_LENGTH $content_length;
  15. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  16. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  17. fastcgi_param REQUEST_URI $request_uri;
  18. fastcgi_param DOCUMENT_URI $document_uri;
  19. fastcgi_param DOCUMENT_ROOT $document_root;
  20. fastcgi_param SERVER_PROTOCOL $server_protocol;
  21. fastcgi_param REQUEST_SCHEME $scheme;
  22. fastcgi_param HTTPS $https if_not_empty;
  23. fastcgi_param GATEWAY_INTERFACE CGI/1.1;
  24. fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
  25. fastcgi_param REMOTE_ADDR $remote_addr;
  26. fastcgi_param REMOTE_PORT $remote_port;
  27. fastcgi_param SERVER_ADDR $server_addr;
  28. fastcgi_param SERVER_PORT $server_port;
  29. fastcgi_param SERVER_NAME $server_name;
  30. fastcgi_param REDIRECT_STATUS 200;
  31. {% if nginx_fpm_openbasedir_enforced %}
  32. fastcgi_param PHP_ADMIN_VALUE "upload_tmp_dir=/tmp\nopen_basedir=$document_root:/tmp:/usr/share:/tmp:/dev/random:/dev/urandom";
  33. {% endif %}
  34. fastcgi_pass fpm-backend;
  35. fastcgi_index index.php;
  36. fastcgi_buffer_size 8m;
  37. fastcgi_buffers 8 8m;