Sample config examples for configuring Lidarr to be accessible through a reverse proxy.
These examples assume the default port of
8686and a baseurl oflidarr. They also assume your web server (nginx) and Lidarr run on the same server, accessible atlocalhost. If not, use the host IP address or a FQDN for the proxy pass.
Add the following configuration to nginx.conf in the root of your Nginx configuration. Place the code block inside the server context. Full example of a typical Nginx configuration
If you're using a non-standard http/https server port, make sure your Host header also includes it, for example:
proxy_set_header Host $host:$server_portorproxy_set_header Host $http_host
location ^~ /lidarr {
proxy_pass http://127.0.0.1:8686;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
# Allow the API External Access via NGINX
location ~ /lidarr/api {
auth_basic off;
proxy_pass http://127.0.0.1:8686;
}
To organize your Nginx configuration, store each site's config in a separate file. Add include subfolders-enabled/*.conf in the server context of nginx.conf:
server {
listen 80;
server_name _;
# more configuration
include subfolders-enabled/*.conf
}
Create a subfolders-enabled directory next to your nginx.conf, add a .conf file with the configuration above, then restart or reload Nginx. Lidarr should be available at yourdomain.tld/lidarr.
To use a subdomain instead, visit lidarr.yourdomain.tld. Configure an A record or CNAME record in your DNS.
Many free DNS providers don't support this.
Nginx includes the sites-enabled folder by default. Check nginx.conf and add it via the include directive if it's missing — it must be inside the http context. Create a config file in sites-enabled with the following:
For subdomain configuration, set baseurl to
''(empty). This assumes the default port8686and Lidarr on localhost (127.0.0.1). Line 5 sets the subdomain tolidarr.
If you're using a non-standard http/https server port, make sure your Host header also includes it, for example:
proxy_set_header Host $host:$server_portorproxy_set_header Host $http_host
server {
listen 80;
listen [::]:80;
server_name lidarr.*;
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_redirect off;
proxy_http_version 1.1;
proxy_pass http://127.0.0.1:8686;
}
}
Restart Nginx and Lidarr should be available at your selected subdomain.
Add this within an existing VirtualHost site. To use the root of a domain or subdomain, remove lidarr from the Location block and use / as the location.
Don't remove the baseurl from ProxyPass and ProxyPassReverse if you use
/as the location.
<Location /lidarr>
ProxyPreserveHost on
ProxyPass http://127.0.0.1:8686/lidarr connectiontimeout=5 timeout=300
ProxyPassReverse http://127.0.0.1:8686/lidarr
</Location>
ProxyPreserveHost on prevents apache2 from redirecting to localhost when using a reverse proxy.
For a full VirtualHost for Lidarr:
ProxyPass / http://127.0.0.1:8686/lidarr/
ProxyPassReverse / http://127.0.0.1:8686/lidarr/
If you add authentication through Apache, exclude the following paths:
/lidarr/api/