https works for local IP address but not for local IP with application port

897 Views Asked by At

I have Mattermost installed in my server, currently I can login to it by browsing through http://192.168.x.x:8066, I've installed a self-signed cerrtificate for this IP, but when I tried to browse it with https://192.168.x.x:8065, it failed to redirect to the Mattermost page. Below is the configuration of my nginx.conf:

    server {
        listen 443 http2 ssl;
        listen [::]:443 http2 ssl;
        listen 443;
        server_name 192.168.3.201:8066;
        ssl on;
        ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
        ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
        ssl_dhparam /etc/ssl/certs/dhparam.pem;
           }

However, when I just browse the URL without port 8066 , it displays the default nginx page with no errors. What's wrong with my nginx.conf file? I'm still new to nginx FYI. Any suggestions will be very much appreciated.

1

There are 1 best solutions below

1
On

I suggest you follow the example nginx configuration from the documentation here. Start with that config file, updating server_name to be the domain name you want mattermost to be reachable from, and server to be the IP address and port on which mattermost is listening.

Once you've got that working, you can continue through the instructions to #9 which covers setting up SSL.