Apologies: I edited this post because I partially fixed my original problem, but I still have one remaining issue with the unsubscribe_text. Please see update in the reply below. Thank you!
Your software
My Mautic version is:4.4.7
My PHP version is:7.4.30
My Database type and version is: mariadb-10.3.35
Your problem
My problem is:
Hi all: new to Mautic, and just trying to get through initial setup and testing. I have Mautic running on a RHEL (Rocky 8) server on a private network behind a public Nginx reverse proxy.
On my private network, I can access the Mautic dashboard like this:
http://192.168.1.100/ma/s/dashboard
My Nginx reverse proxy and global Site URL setting is configured like:
https://www.example.com/ma/index.php
This seems to work fairly well; for example, on the public side, I can visit https://www.example.com/ma/page/preview/1
and all seems good. However, if I add an image to the landing page, the link on the page looks like this:
https://www.example.com/ma/index.php/media/images/logo.png
and the backend (Mautic) webserver does a 301 redirect to:
http://192.168.1.100/ma/media/images/logo.png
In other words, it seems that if I’m calling for the “index.php” file, it rewrites the URL to the wrong BASE URL, not the one set up in the Mautic General Settings. I took a look at the .htaccess
file and found that if I edit the RewriteRule on line 37, replacing the %{ENV:BASE}
with https://www.example.com/ma
, the problem is fixed. So, basically wondering if there’s some other setting that I need to update on the Mautic dashboard to fix this the correct way?
The second issue that I’m seeing is somewhat related. I sent a test campaign to see if the {unsubscribe_url}
is set correctly to show my Contact Preference Page. Again, I’m seeing the wrong base URL in the unsubscribe_url: I’m seeing this in the email: http://192.168.1.100/ma/email/unsubscribe....
instead of https://www.example.com/ma/...
.
Steps I’ve tried to fix the problem:
Manually edited .htaccess
file to fix the image loading problem: a hack, but seems to work.
Not sure how to fix the unsubscribe_url problem.
Thanks in advance for your help!
UPDATE: I think I may have fixed the problem regarding the Nginx proxy.
On my nginx proxy, I added the following to my config:
proxy_set_header Host $host;
This ensures that the original host (www.example) is sent to the backend (Mautic) server, which seems like it fixed the issue with the .htaccess
file.