Skip to content
Snippets Groups Projects
Forked from GéoContrib / Géocontrib Frontend
1567 commits behind the upstream repository.
nginx.conf 1.30 KiB
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 = / {
        absolute_redirect off;
        return 301 /geocontrib/ ;
    }

    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;
    }
}