Search code examples
linuxubuntuhttp-redirectwildflyhttp2

How to make Wildfly 10.1.0 work in port 80 and 443 (SSL) with h2 (HTTP/2) protocol in Linux Ubuntu 16.04


I'm trying to make the wildfly work on ubuntu in production.

I was able to make it work with its standard 8080 and 8443 ports, and managed to redirect ports 80 to 8080 and 443 to 8443 using iptables from ubuntu.

But when performing this redirection, the page opens in https but the h2 protocol (HTTP / 2) and gzip do not work. If I go direct in the standard wildfly protocol (www.example.com:8443) gzip and h2 work perfectly.

Here is the iptables redirect command:

Iptables -t nat -A PREROUTING -i eth0 -p tcp -dport 80 -j REDIRECT --to-port 8080

Iptables -t nat -A PREROUTING -i eth0 -p tcp -dport 443 -j REDIRECT --to-port 8443

I've tried using nginx to do the redirect and the same problem happens. I also tried configuring wildfly to use port 80 and 443 directly but Ubuntu does not allow it.

I have the following status in firewall: ufw status verbose of server

If there is a way to make the wildfly in port 80 and 443 or make the redirect work in h2 and gzip.

System:

  • Ubuntu : 16.04.1

  • Wildfly : 10.1.0.Final

Please help me solve this problem.

Thank you very much.


Solution

  • I just found the solution. The problem is in my Windows 10 Anti-Virus (More specifically BitDefender 2017).

    All the tests I did was on a Windows 10 operating system, by the time I switched to Linux (I have dual boot) the site finally got http2 So I saw that the name of the issuer of the certificate that was being used was: Bitdefender Personal CA.Net-Defender.

    It was at this point that I realized that my certificate created by letsencrypt was being overwritten by another bitdefender certificate.

    SOLUTION: In BitDefender enter the module settings, and go to the internet module and disable the option to verify SSL certificates. Restart your browser and you're done.

    So beware when testing a website using an antivirus.