Web Server Firewall
- Ubuntu
Choose your web server from the tabs mentioned below:
- Nginx
- Apache2
Nginx Firewall Configuration
Before testing Nginx, the firewall software needs to be configured to allow access to the service. Nginx registers itself as a service with ufw upon installation, making it straightforward to allow Nginx access.
List the application configurations that ufw knows how to work with by typing:
sudo ufw app list
It is recommended to enable the most restrictive profile which will still allow the traffic you’ve configured. Since you haven’t configured SSL for the server, you’ll only need to allow traffic on port 80:
sudo ufw allow 'Nginx HTTP'
Verify the change by checking the status:
sudo ufw status
Apache2 Firewall Configuration
List the firewall application profiles by running the command:
sudo ufw app list
Output will be a list of the application profiles

It is recommended to enable the most restrictive profile which will still allow the traffic you’ve configured. Since you haven’t configured SSL for the server, you’ll only need to allow traffic on port 80:
sudo ufw allow 'Apache'
Verify the change by checking the status:
sudo ufw status
The output will provide a list of allowed HTTP traffic:
