# Protecting Mautic against DDOS?

**URL:** https://forum.mautic.org/t/protecting-mautic-against-ddos/25263
**Category:** Product Support
**Created:** [September 1, 2022, 6:00pm UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263 "2022-09-01T18:00:30Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [September 1, 2022, 6:00pm UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263/1 "2022-09-01T18:00:30Z")

</div>

Hi

I was wondering if anyone has any creative ways to protect Mautic server against DDOS ?

We looked at using Cloudflare but using nginx it seems to not work properly. Does anyone know if we use Apache2 it would be easier with Cloudflare.

Or if someone has creative thoughts against DDOS.

Thanks

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [September 1, 2022, 8:45pm UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263/2 "2022-09-01T20:45:41Z")

</div>

Maybe configuring service such as fail2ban might help. I would also consider locking down mautic in a way that admin/marketer stuff (everything behind login & login itself) would be possible from specific IP (maybe VPN).

As for the public facing part of mautic - configuring rules within fail2ban should help.

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [September 2, 2022, 7:32am UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263/3 "2022-09-02T07:32:32Z")

</div>

Hi, what’s the problem with Cloudflare + nginx? https issues?

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [September 2, 2022, 9:23am UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263/4 "2022-09-02T09:23:39Z")

</div>

when behind proxy it errors out on multiple redirects.  
If it is set to DNS only all is good, but then I guess it is not protected

if I go directly to IP/s/dashboard all is good but without https

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [September 2, 2022, 9:43am UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263/5 "2022-09-02T09:43:33Z")

</div>

Looks like pretty common issue, did you try any resolutions listed on the link here:

[https://support.cloudflare.com/hc/en-us/articles/115000219871-Troubleshooting-redirect-loop-errors-](https://support.cloudflare.com/hc/en-us/articles/115000219871-Troubleshooting-redirect-loop-errors-)

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [September 2, 2022, 11:31am UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263/6 "2022-09-02T11:31:55Z")

</div>

Add this as first line in mautic’s index.php right after the php opening tag:

$\_SERVER[‘HTTPS’] = ‘on’;

Your redir problems will be solved 🙂

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [September 2, 2022, 11:39am UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263/7 "2022-09-02T11:39:51Z")

</div>

I do not mean to step on anyone´s toes here but this should really be a temporary solution if you want to always use https just redirect from http to https (as far as I understood it earlier this can be done on cloudflare level).

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [September 2, 2022, 11:54am UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263/8 "2022-09-02T11:54:27Z")

</div>

I agree, this is a short term hack.  
How would you do it in an elegant way?

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [September 2, 2022, 12:17pm UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263/9 "2022-09-02T12:17:25Z")

</div>

I do not use Cloudflare so I cannot test it, but on the link above, there is instruction to turn off redirect from http to https on your web server (apache, nginx) and configure it, in Cloudflare platform.

I would try to follow the Cloudflare docs first and only then resort to some alternative solution.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)
#### Post date: [September 4, 2022, 12:17am UTC](https://forum.mautic.org/t/protecting-mautic-against-ddos/25263/10 "2022-09-04T00:17:49Z")

</div>

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