upstream geocontrib_site {
    server geocontrib:5000;
}

server {
    listen 80;
    charset utf-8;
    server_name  127.0.0.1;
    root /usr/share/nginx/html;

    client_max_body_size 4G;

    location /geocontrib/api {
        proxy_pass_header Set-Cookie;
        proxy_set_header X-NginX-Proxy true;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_read_timeout 300s;
        proxy_redirect off;
    
        proxy_pass http://geocontrib_site;
    }

    location /geocontrib/admin {
        proxy_pass_header Set-Cookie;
        proxy_set_header X-NginX-Proxy true;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_read_timeout 300s;
        proxy_redirect off;
    
        proxy_pass http://geocontrib_site;
    }

    location /geocontrib/static/ {
        alias /opt/geocontrib/static/;
    }

    location /geocontrib/media/ {
        alias /opt/geocontrib/media/;
    }

    location /geocontrib/ {
        index index.html;
        try_files $uri $uri/ /geocontrib/index.html;
    }
   

}

