How to return a folder in django views for using it in nginx proxy_pass?

I have 1 main server, where django and html with css, js located. While I am also have proxy server, that contains only nginx file that proxy_pass to django main server(by domain name) and receive site html code and another static. Here is my nginx file:

server {
    server_name 11.111.111.111;

    index index.html

    location / {
        proxy_pass http://example.com/api/v1/render/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Photo $scheme;
    }
}

And after this I have 404 error. What I am need to do in django view /api/v1/render to return a folder with index.html, css and js scripts, that would be shown on 11.111.111.111 url? It also hasn't traces, that proxy_pass really works, because main server don't receive any requests. Thanks for help.

Nginx renders files and not folders, i dont get why you want to want to do it like this.

Back to Top