Can't get nftables to redirect port 80 to 8080
<p>I've tried setting up my server so it redirects traffic for port 80 to port 8080, but it doesn't work. (I get "Connection refused" errors if I telnet to port 80, and "Unable to connect" with firefox.)</p>

<p>I have been able to get it to work using iptables, but would prefer using nftables. Does anybody have an idea what the problem might be? (In case it's relevant, the server is running on linode.com, with a kernel provided by linode.)</p>

<p>I've got the following in /etc/nftables.conf:</p>

<pre><code>#!/usr/sbin/nft -f

flush ruleset

table ip fw {
        chain in {
                type filter hook input priority 0;

                # accept any localhost traffic
                iif lo accept

                # accept traffic originated from us
                ct state established,related accept

                # accept ssh, alternative http
                tcp dport { ssh, http, http-alt } ct state new counter accept

                counter drop
        }
}

table ip nat {
        chain prerouting {
                type nat hook prerouting priority 0;
                tcp dport http redirect to http-alt
        }

        chain postrouting {
                type nat hook postrouting priority 0;
        }
}
</code></pre>