pga_vhost.j2 1001 B

12345678910111213141516171819202122232425262728293031323334353637
  1. {% if ansible_prolog -%}
  2. {% from 'templates/ansible/prolog.j2' import prolog with context %}
  3. {{ prolog() }}
  4. {% endif -%}
  5. # Nginx vhost for phppgadmin
  6. server {
  7. listen {%if phppgadmin_vhostip %}{{ phppgadmin_vhostip }}:{% endif %}{{ phppgadmin_vhostport }};
  8. server_name {{ phppgadmin_vhostname }};
  9. access_log /var/log/nginx/pma.access.log;
  10. error_log /var/log/nginx/pma.error.log;
  11. root /usr/share/phppgadmin;
  12. index index.php;
  13. try_files $uri $uri/ /index.php;
  14. {% if phppgadmin_http_auth %}
  15. auth_basic "Restricted Access";
  16. auth_basic_user_file /etc/nginx/auth_admin;
  17. {% if phppgadmin_http_whitelist_ip|length > 0 %}
  18. {% for ip in phppgadmin_http_whitelist_ip %}
  19. allow {{ ip }};
  20. {% endfor %}
  21. deny all;
  22. satisfy any;
  23. {% endif %}
  24. {% endif %}
  25. client_max_body_size 128m;
  26. location ~ \.php(/|$) {
  27. include fastcgi_pass_fpm;
  28. fastcgi_param PHP_ADMIN_VALUE "max_execution_time=240\nupload_max_filesize=128M\npost_max_size=128M";
  29. }
  30. }