ansible-role-nextcloud/docs/examples/nginx_conf.yml

36 lines
1.5 KiB
YAML
Raw Permalink Normal View History

---
# https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf
- name: Nextcloud | Configure nginx with the template
ansible.builtin.template:
2023-07-15 13:56:57 +00:00
src: templates/nginx.conf.j2
dest: /etc/nginx/nextcloud_template.conf
# https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf
- name: Nextcloud | Configure nginx to include the template
ansible.builtin.import_role:
name: nginxinc.nginx_core.nginx_config
vars:
nginx_config_http_template_enable: true
nginx_config_http_template:
- template_file: http/default.conf.j2
deployment_location: "/etc/nginx/conf.d/nextcloud_{{ inventory_hostname }}.conf"
backup: false
config:
upstreams:
- name: php-handler
servers:
- address: "{{ nextcloud_fpm_upstream }}"
servers:
- core:
listen:
- address: "{{ default_interface_ipv4_address|default(ansible_default_ipv4.address) }}:{{ nextcloud_https_port|default(4440) }} ssl"
include:
- "/etc/nginx/acme_{{ inventory_hostname }}.conf"
- /etc/nginx/nextcloud_template.conf
2023-08-07 13:13:44 +00:00
http2: # requires nginx_core.nginx_config >= 0.7.0
enabled: true
headers:
add_headers:
- name: X-Real-IP
value: $remote_addr