server {
    server_name mapstore.digitribe.fr;

    listen 80;
    listen [::]:80;

    server_tokens off;

    root /usr/share/nginx/html;

    location / {
        try_files $uri @mapstore;
    }

    location /mapstore/ {
        try_files $uri @mapstore;
    }

    location /rest/geostore/ {
        proxy_pass http://mapstore:8080/mapstore/rest/geostore/;
        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-Proto $scheme;
    }

    location /mapstore/rest/geostore/ {
        proxy_pass http://mapstore:8080/mapstore/rest/geostore/;
        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-Proto $scheme;
    }

    location @mapstore {
        proxy_pass http://mapstore:8080;
        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-Proto $scheme;
    }
}
