521 even on flex

I dont understand, please answer these questions, so we can proceed:

  1. Is server2 running on a arm64 CPU?
  2. Is mautic running on server2?
  3. Is mautic running in server2 in a container or installed on the hostOS?
  1. Is server2 running on a arm64 CPU? Yes
  2. Is mautic running on server2? Yes
  3. Is mautic running in server2 in a container or installed on the hostOS? on the hostOS: ubuntu 22.04 - apache2

Ok, but you shall not forward unencrypted traffic from Server1 NPM to Server2, as it would be unencrypted.

Please do as follow:

  1. Install Docker and Docker compose on Server2
  2. install NPM (there is arm64 OS/ARCH available) on Server2
  3. set it up and create the very same m.theapothecary.app there.

Set it up like this:

NPM Server2:

Source Destination SSL
m.theapothecary.app<mautic_port> Custom

Then it should work. Just make sure you also install the very same Cloudflare origin SSL cert on the second NPM2 aswell.

This is the only secure way, if you have two servers as you will need one NPM for each server, otherwise it is not secure as unencrypted traffic then gets send to external IPs.

If I had an image for Mautic that is arm64, I would have put it on server1.
But thanks, I will try to buy one.

Only I thought it worked because I did configure Mautic, access dashboard etc… with LE certs… oh well…

You don’t need to run Mautic on docker, but NPM needs to be installed on both servers and the NPM on server2 needs to be configured like mentioned above.

1 Like

Aahhhh, ur the cutest!!! Many likes on this!! So relieving! :upside_down_face:
@epic.network was on top of my list of best friends on communities followed by @neiljay , now you are moved to top. Being all the other Mautic guys blacklisted as torturers, along with my nephew.

1 Like

No worries, we are not done yet.

Tell us, when you are done with all this, then we check all domains again and if they run properly.


Before I deal with server2, I fixed Server1:



Result for both domain and www: Error 502 Bad Gateway.

1 Like

I see. For the docker-hostname to work they need to be in the same docker-network. I don’t know for sure if that is the case in your setup. So for now please go back to the internal or external IP, so that it works again.

But the “502 bad gateway” error actually points to: wordpress container is not responding on port 8000

on private IP (of the instance) port 80: ERR_TOO_MANY_REDIRECTS

Should be port 8000, right? On which port did you map the wordpress container?


Then please set it to:


Sorry, the port with this mapping, should be the internal Port of the container. My mistake.

I tried the container IP: 172.xx.x.x:80


Sorry, that does not work. Please change it in NPM to http://wordpress:80 and try again.

Dear @M4rt1n @epic.network @fritex @neiljay,
This is just to say, after a long time trying to put this to work on my own, I finally figured out there are many missing pieces of the puzzle that I should have put together and that they are beyond the scope of this community. Nonetheless, M4rt1n went out of his way and help me in private, accessing my environment and fixing things up.

So here is my thank you with the right hand on my heart for you who collaborated with the process, both in this thread and on others.

Keep being this great!


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.