web's firewall is off: every port it listens on is open to every machine, the shop app's 8080 too. Only nginx's ports should be: the app is reached through nginx.
New command
sudo ufw allow
Adds a rule that lets connections to that port in. While the firewall is off, it only says Rules updated.
Usagesudo ufw allow port/tcp
text
learner@web:~$ sudo ufw allow 80/tcp
Rules updated
Rules updated (v6)New command
sudo ufw enable
Turns the firewall on: from now on, only what the rules allow gets in.
Usagesudo ufw enable
text
learner@web:~$ sudo ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startupObjectives
- Switch on web's firewall without locking yourself out.
- Let web pages in, and nothing else.