Answer the question
In order to leave comments, you need to log in
What needs to be done with nginx so that it gives .json files over https?
Hello.
I deal with https and ran into a problem that on the json page the file is loaded via http.
Because of this, a mixed content error occurs (in my opinion). I don't think this is correct.
In the code I write a relative path //mysite.dev/file.json
Apparently the problem is in nginx
This did not help:
server {
listen 443;
/*ssl*/ тут всякая ерунда про ssl
location ~ ^/(file.json) {
try_files $uri $uri/ /index.php?$args; //yii2
}
}
Answer the question
In order to leave comments, you need to log in
Apparently, in your HTML code itself, the link to json is specified via http. https in Nginx needs to be configured for the entire domain, not for individual files.
PS. Use just two slashes (//) instead of http:// ( https://) in your code, then there will be a minimum of such problems. Good luck!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question