You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.5 KiB

  1. ---
  2. - name: Manage nginx webserver
  3. collections: [ 'debops.debops', 'debops.roles01',
  4. 'debops.roles02', 'debops.roles03' ]
  5. hosts: [ 'debian10' ]
  6. become: True
  7. environment: '{{ inventory__environment | d({})
  8. | combine(inventory__group_environment | d({}))
  9. | combine(inventory__host_environment | d({})) }}'
  10. vars:
  11. nginx_acme: False
  12. nginx_http_extra_options: |
  13. client_max_body_size 100M;
  14. nginx_real_ip_from: ['172.16.30.0/24']
  15. nginx_default_keepalive_timeout: 65
  16. # nginx_webroot_create: False
  17. nginx_ocsp: False
  18. nginx_worker_processes: auto
  19. nginx__servers:
  20. - name: vam-teplee
  21. type: php
  22. root: /var/www/vam-teplee
  23. public_dir_name: ''
  24. include_files_begin:
  25. - includes.d/www.conf
  26. - includes.d/octobercms.conf
  27. - includes.d/staticfiles.conf
  28. options: set $upstream unix:/run/php7.4-fpm-www-data.sock;
  29. location_list:
  30. - pattern: '/'
  31. options: rewrite ^/.*$ /index.php last;
  32. locations:
  33. - pattern: '~ ^/*.-backend/'
  34. options: set $upstream unix:/run/php7.4-fpm-backend.sock;
  35. - pattern: '~* ^(?!/index).*\.php$'
  36. options: return 403;
  37. php_options: |
  38. fastcgi_read_timeout 3000;
  39. php_upstream: $upstream
  40. #location ~ ^(?!.+\.php/)(?<script_name>.+\.php)$ {
  41. php_location_script_name: ~ ^(?<script_name>/index\.php)
  42. #location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
  43. php_location_path_info: ~ ^(?<script_name>/index\.php)(?<path_info>/.*)?
  44. pre_tasks:
  45. - name: Copy OctoberCMS nginx conf includes and www redirect
  46. copy:
  47. src: "{{item}}"
  48. dest: /etc/nginx/
  49. mode: 0644
  50. loop:
  51. - nginx/includes.d
  52. roles:
  53. - role: keyring
  54. tags: [ 'role::keyring', 'skip::keyring', 'role::nginx' ]
  55. keyring__dependent_apt_keys:
  56. - '{{ nginx__keyring__dependent_apt_keys }}'
  57. - role: apt_preferences
  58. tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
  59. apt_preferences__dependent_list:
  60. - '{{ nginx__apt_preferences__dependent_list }}'
  61. - role: python
  62. tags: [ 'role::python', 'skip::python' ]
  63. python__dependent_packages3:
  64. - '{{ nginx__python__dependent_packages3 }}'
  65. python__dependent_packages2:
  66. - '{{ nginx__python__dependent_packages2 }}'
  67. - role: nginx
  68. tags: [ 'role::nginx', 'skip::nginx' ]