mautic / docker-mautic

Docker Image for Mautic
https://www.mautic.org
362 stars 274 forks source link

Mautic on subdirectory - How to prevent redirect #213

Open MerlinB opened 2 years ago

MerlinB commented 2 years ago

I am trying to set up mautic on a sub-directory but it will always redirect to /[some path] instead of using the sub-directory /mautic/[some path]. I am using the mautic4 docker image.

This is working fine for other containers I am running on various sub-directories using the same method. Is there some way to tell Mautic about what directory it is running on?

Here are the relevant parts of my Nginx config:

upstream mautic {
    server mautic:80;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name ${DOMAIN} www.${DOMAIN};

    ssl_certificate /etc/letsencrypt/live/${DOMAIN}/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/${DOMAIN}/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/${DOMAIN}/chain.pem;
    ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;

    location /mautic/ {
        proxy_pass http://mautic/;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_redirect off;
    }
}
--- Want to back this issue? **[Post a bounty on it!](https://app.bountysource.com/issues/108499080-mautic-on-subdirectory-how-to-prevent-redirect?utm_campaign=plugin&utm_content=tracker%2F20392502&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://app.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F20392502&utm_medium=issues&utm_source=github).