Why is ufw blocking https access to nginx?

ufw is set to allow full access to nginx web server, but blocks https

dmesg error report: [Fri Jun 28 02:56:17 2019] [UFW BLOCK] IN=enp4s0 OUT= MAC=01:00:5e:00:00:01:20:c0:47:13:01:15:08:00 SRC= DST= LEN=36 TOS=0x00 PREC=0xC0 TTL=1 ID=33361 DF PROTO=2

http requests are passed successfully


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


When it comes to ufw, I often recommend a full reset to ensure the firewall is properly configured to meet the specific needs of what I’m using the server for. In some cases, it’s often best to specify the ports versus using the shortcodes.

I posted a quick guide on how to reset ufw, which may be helpful for future use.

Found two problems. In setting up my certificate I had started a new serverblock for my website but not completed it. I was working with the default serverblock to work out the firewall problems. Both server blocks (which now had my domain name in them) were in the sites-enabled folder and that screwed up the firewall.

The second problem was the snakeoil snippet pointing which pointed to a certificate that was truly snakeoil. Deleting that snippet and pointing to the correct certificate and key fixed the problem.


Can you try explicitly allowing Nginx HTTPS as well with this command:

ufw allow 'Nginx HTTP'

Then after that run this command to verify your change:

ufw status

Hope that this helps! Bobby