How to Redirect Bitbucket Server Traffic to Port 80 on Linux

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

目的

As described on the document below:

You can bind Bitbucket Server 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 Bitbucket Server listens to. 

ソリューション

  • If you've got Bitbucket Server 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
  • If you are running Bitbucket Server on your own workstation, and connecting to Bitbucket as http://localhost:7990, you might need to add another rule to your Iptables as PREROUTING is not used by the loopback interface, it is done by the OUTPUT rule

    iptables -t nat -A OUTPUT -i <your network interface> -p tcp -o lo --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.

最終更新日 2022 年 5 月 24 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.