Self-Hosted Moralis Server Mixed Content Error SSL

I try to setup Unity+Self-Hosted Server (on my own VDS). I sucsesfuly start Moralis server on localhost. But when I try connet WebGL Unity project from https url - I get warning

Mixed Content: The page at 'https://*****.dev/' was loaded over HTTPS, but requested an insecure resource 'http://******:1337/server/functions/getServerTime'. This request has been blocked; the content must be served over HTTPS.

My hosting doesn’t support SSL for localhost. I have another domains, but when try to use it - its unable to connect to anything besides localhost. Probably anybody can help with setup .env file for my solution with custom domain+ssl?

Sorry for poor English and questions

Another words - How setup self-hosted Moralis Server on custom domain with ssl not on localhost?)

Another words - How setup self-hosted Moralis Server on custom domain with ssl not on localhost?)

try to set https for your server url, you could use cloudflare for an implicit ssl connection

you should be able to make it work over https on localhost too, you have to make those specific configurations with a server like nginx

you will need a public url too, to be able to access it from the internet for your parse server

Yeah, I tried it already. It’s don’t connect. My hoster says to me that it’s no technical solutions to enable ssl for localhost, only for custom domains

from where you are trying to access that local host url?

does it work if you type it directly in the browser?

I tried too use settings like SERVER_URL = 'https://mydomain:1337/server'

what error did you get in this case?

If i tryint to access from http://someurl.com everything is OK. But if I try to access from domain with ssl - I got the problem with Mixing Content

Like that

ok, you can access it from that http url until you have a https connection for your parse server

you can install for example nginx to handle https connections

Another problem, that if I use Unity project on domain without ssl - Chrome and another browsers block my site, I need ssl for main site. And need ssl for parse server. But hosting can’t provide ssl for localhost( That’s shit!)

where from is that output?

you can try to understand how https works in general

1 Like

In log of the server.
Now I try another server with ssl for localhost. I think it’s will be ok

It wouldn’t make sense if they did because anyone can use localhost or 127.0.0.1 - a certificate wouldn’t mean anything in that case. You can use a self-signed certificate for testing HTTPS locally.

Later when you deploy your self-hosted server you can get a certificate from Let’s Encrypt.

1 Like