How to configure Team Studio to redirect port 80 to 8080?

How to configure Team Studio to redirect port 80 to 8080?

book

Article ID: KB0076847

calendar_today

Updated On:

Products Versions
Spotfire Data Science 6.4.1 and earlier

Description

Configure TIBCO Data Science Team Studio to redirect port 8080 to 80.  This does not change the port on Team Studio, instead it uses iptables or firewalld to redirect all traffic on port 80 to port 8080.

Issue/Introduction

How to configure Port Forwarding from 80 to 8080 for Team Studio with the help of Firewalld or iptables.

Resolution

Configure TIBCO Data Science Team Studio to redirect port 8080 to 80

1. Modify $CHORUS_HOME/releases/<your 6.0 release or higher>/vendor/nginx/nginx.conf.erb, taking care to modify the correct portion for Team Studio workflows, as there are multiple locations for "proxy_set_header Host"

Modify Line 200

Please make sure line 200 is using $host instead of:

proxy_set_header Host $host:$server_port;

2. Restart Team Studio

If Jupyter Notebooks server is running on the same machine as Team Studio server, you'll need to make this change or else the kernel won't be able to communicate with Team Studio.

Modify Line 164

Line 164:  Notice this is another proxy_set_header, make the same change as step 1 above. This is for the docker container.  When this is not set, the symptom is that you either need to use port 8080 for using Notebooks and if you don't, the kernel is consistently busy and you won't be able to run jobs.

Now we need to configure the firewall rules that will forward port 80 to 8080.  You can do this 2 ways, using iptables or Firewalld.

Using iptables:

Set iptables to redirect by using this rule:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
Output of IPTables

Using Firewalld:
Start Firewalld Service:
systemctl start firewalld

Create Masquerade:
firewall-cmd --zone=public --add-masquerade --permanent

Create policy that will forward port 80 to 8080:
firewall-cmd --zone=public --add-forward-port=port=80:proto=tcp:toport=8080 --permanent

Reload Firewall Policy:
firewall-cmd --reload

List Firewall Policy:
firewall-cmd --reload
Output of firewalld