Network

Sonarr should be run via a Reverse Proxy, allowing you to isolate and wrap connections in SSL. See NGINX for more details. See Setup Base Proxy Control for basic proxy configuration.

See Sonarr reverse proxy reference.

Ports

---
###############################################################################
# Ports Configuration
###############################################################################
# Ports should be managed externally via an OS role.
#
# Reference:
# * https://docs.ansible.com/ansible/latest/collections/community/general/ufw_module.html

ports:
  - {proto: 'tcp', from_ip: 'any',       to_port: 8989, direction: 'in', comment: 'sonarr http'}
  - {proto: 'tcp', from_ip: '127.0.0.1', to_port: 8989, direction: 'in', comment: 'sonarr http api'}
  - {proto: 'tcp', from_ip: 'any',       to_port: 9898, direction: 'in', comment: 'sonarr https'}
  - {proto: 'tcp', from_ip: '127.0.0.1', to_port: 9898, direction: 'in', comment: 'sonarr https api'}

Using Subdomains

0644 root root nginx/conf.d/reverse-proxy.conf
server {
  listen       443 ssl http2;
  server_name  sonarr.{DOMAIN} sonarr;

  location / {
    proxy_pass http://sonarr:8989;
    include    /etc/nginx/conf.d/proxy-control.conf;
  }
}

Using Subpaths

0644 root root nginx/conf.d/reverse-proxy.conf
server {
  location /sonarr {
    proxy_pass http://sonarr:8989/sonarr;
    include    /etc/nginx/conf.d/proxy-control.conf;
  }
}

Note

Set sonarr_url_base to /sonarr before enabling the reverse-proxy.

ansible_sonarr_vars.yaml
sonarr_url_base: '/sonarr'