Nginx server with reverse proxy to multiple dockers does not load images using relative urls

I have a website that uses multiple docker containers running different parts of the website(on different ports) one of which is a discourse module. I wanted all these modules to be accessed via sub-directories. So that xyz.in/discuss will lead to the port corresponding to the discourse docker container and so on. This is the Nginx conf for the base OS that listens to port 80 :

server {
    listen 80;
    server_name xyz.in www.xyz.in;

    location /discuss {
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:8045/;
        proxy_redirect off;
    }
    location /socialize {
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:8080/;
        proxy_redirect off;
    }
    location / {
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:8020/;
        proxy_redirect off;
    }
}
server {
    listen 80;
    server_name discuss.xyz.in;
    location / {
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:8045/;
        proxy_redirect off;
    }
}

The first server module handles segregating the sites according to the sub-directory, pointing towards 3 docker containers, the second server handles the absolute url used for href and src. The problem I am facing is the relative urls, eg: <img class="tada" src="/images/wizard/tada.svg"> does not work but <img class="tada" src="http://discuss.xyz.in/images/wizard/tada.svg"> is working and so is <img class="tada" src="http://xyz.in/discuss/images/wizard/tada.svg">. I am assuming this might because the relative url points to the base server path i.e.xyz.in/images/wizard/tada.svg instead of the docker container where it is actually stored.

My question is how to make the relative urls work using the nginx config, since i cannot make changes to the html code. What to add/remove/change to the existing conf file so that the relative path is properly redirected.

Source: StackOverflow