ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Tomcat with an NGINX Reverse Proxy and Self-signed SSL Certificate

    IT Discussion
    nginx tomcat
    4
    11
    1.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Start with netstat. Is nginx listening?

      netstat -tulpn
      
      wirestyle22W 1 Reply Last reply Reply Quote 0
      • wirestyle22W
        wirestyle22 @scottalanmiller
        last edited by wirestyle22

        @scottalanmiller said in Tomcat with an NGINX Reverse Proxy and Self-signed SSL Certificate:

        Start with netstat. Is nginx listening?

        netstat -tulpn
        

        Edited for accuracy

        M 1 Reply Last reply Reply Quote 0
        • M
          marcinozga
          last edited by

          Few obvious things to check for

          • open ports
          • selinux
          • run nginx -t to verify config
          • post nginx logs
          1 Reply Last reply Reply Quote 0
          • M
            marcinozga @wirestyle22
            last edited by

            @wirestyle22 said in Tomcat with an NGINX Reverse Proxy and Self-signed SSL Certificate:

            @scottalanmiller said in Tomcat with an NGINX Reverse Proxy and Self-signed SSL Certificate:

            Start with netstat. Is nginx listening?

            netstat -tulpn
            
            Active Internet connections (only servers)
            Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
            tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      26420/nginx: master
            tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      913/sshd
            tcp6       0      0 :::8443                 :::*                    LISTEN      25783/java
            tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      25783/java
            tcp6       0      0 :::8009                 :::*                    LISTEN      25783/java
            tcp6       0      0 :::80                   :::*                    LISTEN      26420/nginx: master
            tcp6       0      0 :::8080                 :::*                    LISTEN      25783/java
            tcp6       0      0 :::22                   :::*                    LISTEN      913/sshd
            udp        0      0 127.0.0.1:323           0.0.0.0:*                           866/chronyd
            udp6       0      0 ::1:323                 :::*                                866/chronyd
            

            Looks like Nginx is not listening on port 443. Did you restart the service after config change?

            wirestyle22W 1 Reply Last reply Reply Quote 1
            • wirestyle22W
              wirestyle22 @marcinozga
              last edited by wirestyle22

              @marcinozga said in Tomcat with an NGINX Reverse Proxy and Self-signed SSL Certificate:

              @wirestyle22 said in Tomcat with an NGINX Reverse Proxy and Self-signed SSL Certificate:

              @scottalanmiller said in Tomcat with an NGINX Reverse Proxy and Self-signed SSL Certificate:

              Start with netstat. Is nginx listening?

              netstat -tulpn
              
              Active Internet connections (only servers)
              Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
              tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      26420/nginx: master
              tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      913/sshd
              tcp6       0      0 :::8443                 :::*                    LISTEN      25783/java
              tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      25783/java
              tcp6       0      0 :::8009                 :::*                    LISTEN      25783/java
              tcp6       0      0 :::80                   :::*                    LISTEN      26420/nginx: master
              tcp6       0      0 :::8080                 :::*                    LISTEN      25783/java
              tcp6       0      0 :::22                   :::*                    LISTEN      913/sshd
              udp        0      0 127.0.0.1:323           0.0.0.0:*                           866/chronyd
              udp6       0      0 ::1:323                 :::*                                866/chronyd
              

              Looks like Nginx is not listening on port 443. Did you restart the service after config change?

              Yes I did. Sorry this was a test. I forgot to update it

              1 Reply Last reply Reply Quote 0
              • wirestyle22W
                wirestyle22
                last edited by wirestyle22

                Same behavior

                Active Internet connections (only servers)
                Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
                tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      26496/nginx: master
                tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      26496/nginx: master
                tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      913/sshd
                tcp6       0      0 :::8443                 :::*                    LISTEN      25783/java
                tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      25783/java
                tcp6       0      0 :::8009                 :::*                    LISTEN      25783/java
                tcp6       0      0 :::80                   :::*                    LISTEN      26496/nginx: master
                tcp6       0      0 :::8080                 :::*                    LISTEN      25783/java
                tcp6       0      0 :::22                   :::*                    LISTEN      913/sshd
                udp        0      0 127.0.0.1:323           0.0.0.0:*                           866/chronyd
                udp6       0      0 ::1:323                 :::*                                866/chronyd
                
                1 Reply Last reply Reply Quote 1
                • dafyreD
                  dafyre
                  last edited by

                  Add

                  ssl on; to the config on the line above ssl_certificate .... ?

                  1 Reply Last reply Reply Quote 1
                  • M
                    marcinozga
                    last edited by

                    https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/

                    You're missing ssl in first server block.

                    server {
                         listen 443 ssl;
                    

                    I don't know if it's strictly required, I'd add it.

                    wirestyle22W scottalanmillerS 2 Replies Last reply Reply Quote 2
                    • wirestyle22W
                      wirestyle22 @marcinozga
                      last edited by wirestyle22

                      @marcinozga said in Tomcat with an NGINX Reverse Proxy and Self-signed SSL Certificate:

                      https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/

                      You're missing ssl in first server block.

                      server {
                           listen 443 ssl;
                      

                      I don't know if it's strictly required, I'd add it.

                      lol fml. That was it. I knew it was something dumb

                      1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @marcinozga
                        last edited by

                        @marcinozga said in Tomcat with an NGINX Reverse Proxy and Self-signed SSL Certificate:

                        I don't know if it's strictly required, I'd add it.

                        Because the one tells the port to listen on. The other tells it what protocol to use. Since you can use any port, with any protocol, it has to be listed. You can just add it to port 80 if you want, for example.

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post