Skip to content

Sample Nginx Subfilter Block

Archmonger edited this page Mar 3, 2019 · 12 revisions

This is a generic nginx server block with SSL encryption that you can use for reference when creating your reverse proxies.

server {
  #Listen on port 443 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 / {
    #These lines are for a standard reverse proxy for Deluge on 192.168.86.150
    proxy_pass http://192.168.86.150:8112;
    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://;

    #This enables nginx subfilter and applies the theme bbf_deluge_webui_in_organizr.css
    proxy_set_header Accept-Encoding "";
    sub_filter '</head>' '<link rel="stylesheet" type="text/css" href="https://archmonger.github.io/Blackberry-Themes/Themes/Blackberry-Flat/bbf_deluge_webui_in_organizr.css"></head>';
    sub_filter_once on;
  }
}
Clone this wiki locally