Not fixable with nginx config
Consider the following html file:
<html>
<head>
</head>
<body>
<img src="http://example.com/some/image.png">
</body>
</html>
If this html file is served over https - it will always generate a mixed content warning. Attempting to fix the subsequent request for /some/image.png
will not work, the request is blocked by the browser and does not reach the server.
Fix the html
The only effective solution is to fix the html source for the main request, such that it requests all assets from https://
also i.e. change the html to this:
<html>
<head>
</head>
<body>
<img
src="/some/image.png"
alt="same domain and port as this html page please"
/>
</body>
</html>
Or this:
<html>
<head>
</head>
<body>
<img
src="https://example.com/some/image.png"
alt="explicit https"
/>
</body>
</html>
In comments you've mentioned wordpress as an example; for a wordpress install the only thing required (in principle, in practice expect some messing about) is to change the site url so that wordpress considers https://example.com
to be the root url for the installation.