How can I access an unsecured link (for images) on my https website

My domain is:

My web server is (include version):

The operating system my web server runs on is (include version):
ubuntu 20.04

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know):

I can access my website using the secure connection

Now the images on my website are taken directly from the backend on port 8000. I can access those images through an insecure url, for example:

However, I cannot access them on my website running on port 443 in Google Chrome.

This line in my react app doesn't display an image.

<img src={} ... />

I believe this is Google chrome's policy that prevents me from loading content from insecure urls on a secure site. My website opens fine on Safari.

Therefore, to access those images on my website, I'm guessing (?) maybe I need to establish a secure connection on port 8000 as well so that I can see images on my website i.e. I would like:

What changes would I need to make in my config file? I tried listen 8000 ssl in the server block but that hasn't worked for me.

upstream api {
      server backend:8000;

server {
    listen 8080;
    server_name mynacode;

    location /.well-known/acme-challenge/ {
        root /var/www/certbot;

    location / {
        return 301 https://$host$request_uri;

server {
    listen 443 ssl;

    server_name mynacode;

    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key  /etc/letsencrypt/live/;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    location / {
            proxy_read_timeout 300s;
            proxy_connect_timeout 75s;
        root /var/www/react;
        try_files $uri /index.html;
        proxy_set_header Host $host;

    location /api/ {
            proxy_read_timeout 300s;
            proxy_connect_timeout 75s;
        proxy_pass http://api;
        proxy_set_header Host $http_host;


"How can I access an unsecured link (for images) on my https website"
I would suggest do not.


Those images are in my backend server. I link them with my frontend react website (through port 8000) to display them. Is there another way to do this that I may be missing

That is a question more appropriate for


Okay, thank you!


Bruce is right that's a basic nginx issue.

Why can't you just make another location block in your port 443 server block for /media/ and proxy back to 8080 from there? Then you use https://(domain)/media/... to get there

Also see your other thread where I don't see the apex domain name working. I see you intend it to as it shows in your server block but your DNS, at minimum, needs work.


Thank you Mike, let me apply your suggestion


Oh, I just realized you have a typo there. Should be:


Looks like you might have fixed that already but thought I'd mention it just the same.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.