How to Redirect Stash Traffic to Port 80 on Linux

'How Do I...' and 'How to...' Guide to Stash

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

Purpose

As described on the document below:

You can bind Stash to a port over 1024 and then configure iptables to redirect traffic from port 80 to the higher port as an alternative to changing the port where Stash listens to. 

Solution

  • If you've got Stash running on port 7990 successfully, you can add a rule to your Iptables so requests to

    iptables -t nat -A PREROUTING -i <your network interface> -p tcp --dport 80 -j REDIRECT --to-port 7990

Please refer to the iptables man page for more details on how to use it.

Notice that there might be network impacts while handling the iptables. This is only a guideline on how you can approach this. Before changing your iptables, make sure you're comfortable with changing these rules. Use this guide at your own risk.

Last modified on Feb 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.