Score:0

My images are getting the upstream name as path

kp flag

I have an ASP.NET application running in a docker container that's being server by an NGINX reverse-proxy also in a docker container.

I'm not experienced at all with NGINX or hosting, so please apologize my ignorance. It took me a while to make it work, but everything is working fine besides the images.

I checked the <img> tags inspecting the browser and the src attribute is being filled with upstream-name/images/logo.png instead of my-domain.com/images/logo.png. These images are being built in runtime since they're store in a database as binaries so I assume there isn't a folder that I am supposed to map in my containers (it was working fine without NGINX).

Is anyone able to help?

This is my nginx.conf file:

worker_processes 1;

events { worker_connections 1024; }

http {

    sendfile on;

    upstream webapp{
        server container;
    }

    server {
        listen [::]:80;
        listen 80;
        server_name my-domain.com;
        return 301 https://$host$request_uri;
    }

    server {
        listen [::]:443 ssl http2;
        listen 443 ssl http2;
        server_name my-domain.com; 
    
    ssl_certificate         /ssl/cert.pem;
        ssl_certificate_key     /ssl/key.pem;
 
        location / {
            
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-Host $host;
            proxy_set_header X-Forwarded-Proto https;
            proxy_pass       http://webapp/;
       }
    }
}
Score:0
kp flag

I was missing proxy_set_header Host {hostname};

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.