7 Reverse Proxy
txtsd edited this page 2022-09-03 22:02:35 +05:30

Note: These examples assume you are using /jackett as your Base Path ("BasePathOverride": "/jackett" in ServerConfig.json).
If your Base Path differs, replace all instances of /jackett with /YourBasePath.
Along with the steps below, you also need to set a base path override which is present under the configuration section on your Jackett dashboard.


Caddy: Edit your Caddyfile. sub.domain.tld is your site.

sub.domain.tld {
    reverse_proxy 127.0.0.1:9117
}

Nginx: To configure Nginx as a reverse proxy to forward requests to your Jackett app, modify /etc/nginx/sites-available/default

location /jackett/ {
    proxy_pass         http://localhost:9117;
    proxy_http_version 1.1;
    proxy_set_header   Upgrade $http_upgrade;
    proxy_set_header   Connection keep-alive;
    proxy_cache_bypass $http_upgrade;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Proto $scheme;
    proxy_set_header   X-Forwarded-Host $http_host;
}

Apache: Configuration files for Apache are located within the /etc/httpd/conf.d/ directory.

    <Location /jackett>
        ProxyPreserveHost On
        Allow from 0.0.0.0 
        ProxyPass "http://127.0.0.1:9117/jackett"
        ProxyPassReverse "http://127.0.0.1:9117/jackett" 
    </Location>

Lighttpd: Configure lighttpd mod_proxy as:

server.modules += (
    "mod_proxy",
)

$HTTP["url"] =~ "^/jackett/" {
    proxy.server = ( "" => ( (
        "host" => "127.0.0.1",
        "port" => "9117",
     ) ) )

    proxy.header = (
        "map-urlpath" => (
            "/jackett/"  => "/",
        ),
    )

    proxy.forwarded = (
        "for"          => 1,
        "proto"        => 1,
    )
}

IIS: The below rule assume you have a "virtual directory" named "jackett" under your default website in IIS. That virtual directory should target a physical directory that resides at c:\inetpub\wwwroot\jackett. Within this directory you would place the below rules in a web.config file. There should be no other files in this directory. (This is NOT your Jackett install directory)

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <remove name="ReverseProxyInboundRuleJackett" />
                <rule name="ReverseProxyInboundRuleJackett" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://localhost:9117/jackett/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>