SSL is only working with domain name but not with private URL of next cloud server

Nextcloud version (eg, 12.0.2):15.01
Operating system and version (eg, Ubuntu 17.04):Ubuntu 18.04
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.1):7.1

The issue you are facing:
SSL is only working with domain name like https://mydomain.com/nextcloud, however, SSL doesn’t work with private IP of webserver. When I open website using private IP, it says that cert is only valid for mydomain.com/nextcloud not for private IP

I really need help, please help me

well. that’s the way it works.
the certificate says: “this is server mydomain.com”.
and if you browse to “192.168.178.101” there is a mismatch in the “name”.

if you really want to use the ip address/internal name you have to create a certificate for them as well. (of course you’ll only get a selfsigned certificate.)
and then you have to setup two additional “webserver”. (just copy the config for “mydomain.com” and rename it to “mycloud.internal”.

1 Like

Hi @vishal_chouhan

If your router supports DNS rebind, it will directly connect you to the local IP address of your server, even if you enter the domain name. If your router doesn’t support that, you can still edit the hosts file on your system, to forward any requests to mydomain.com to your local address. This works pretty well for stationary devices, but is not optimal for mobile devices like laptops which you also use from outside your local network. If the latter is the case for you and you are dependent on the hosts file; I wrote a little powershell lately to automatically edit the hosts file on boot depending on the network you are in.

The hosts file can be found:
Windows: C:\Windows\system32\drivers\etc\hosts
Unix: /etc/hosts

Format:

Example:
192.168.1.200 cloud.yourdomain.com