Skip to content

Sample Nginx Subfilter Block

Archmonger edited this page Oct 2, 2019 · 12 revisions

This is a sample nginx server block for running Deluge (port 8112) behind a reverse proxy on a subdomain with SSL encryption. You can use this for reference when creating your own configuration file.

server {
  # Listen on port 443 (SSL) for the subdomain deluge
  listen 443;
  server_name deluge.mydomain.com;

  # Enable SSL using your certificates
  ssl on;
  ssl_certificate /config/nginx/ssl/cert.pem;
  ssl_certificate_key /config/nginx/ssl/cert.key;

  location / {
    # Pass Deluge through a reverse proxy
    proxy_pass http://192.168.86.150:8112;

    # Forward the HTTP headers. This is standard for all reverse proxies.
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_redirect  http://  $scheme://;

    # Enable subfilter and apply the theme BBF Deluge WebUI in Organizr
    proxy_set_header Accept-Encoding "";
    sub_filter '</head>' '<link rel="stylesheet" type="text/css" href="https://archmonger.github.io/Blackberry-Themes/Themes/Blackberry-Flat/deluge_in_organizr.css"></head>';
    sub_filter_once on;
  }
}
Clone this wiki locally