--- # 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: 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 http2: # requires nginx_core.nginx_config >= 0.7.0 enabled: true headers: add_headers: - name: X-Real-IP value: $remote_addr