DiscussionSLA

SafeLine WAF Domain Mismatch Error with WordPress Sites

Published 3 months ago

# SafeLine WAF
# ❓ question

Published 3 months ago

profile_photo

Braga aka Sl1mJ0e

Updated 3 months ago

0

Hey Guys,
Hope you doing well!

I'm trying to implement SafeLine WAF to protect WordPress sites hosted on CloudPanel, but I'm getting a "Bad Gateway" (clouflare) when accessing my site.

My Setup

  • CloudPanel for WordPress hosting (sites run on port 8080)
  • Cloudflare for DNS and SSL certificates (Strict mode)
  • Nginx as reverse proxy (Using the cloudpanel)

Configuration
I've set up SafeLine with:

  • Domain: mydomain.com
  • Port: 4435 (with SSL)
  • Using the same SSL certificate as my WordPress site
  • Upstream points to http://127.0.0.1:8080

My Nginx is configured to route all traffic through SafeLine first:
nginx

location / {
proxy_pass http://127.0.0.1:4435;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header X-Varnish;
proxy_redirect off;
proxy_max_temp_file_size 0;
proxy_connect_timeout 720;
proxy_send_timeout 720;
proxy_read_timeout 720;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
}

What I've Tried

  • Confirmed the domain in SafeLine exactly matches what I'm accessing
  • Tried both HTTP and HTTPS for the proxy_pass directive
  • Verified SafeLine is running and listening on the correct port
  • Temporarily pointed Nginx directly to WordPress (which works fine)

Any ideas why im getting this error and how can i fix it?
The same setup is working for other services hosted in the same server (like containers).
image.png

profile_photo

Braga aka Sl1mJ0e

Updated 3 months ago

0

SafeLine WAF Bad Gateway Error with WordPress Sites

profile_photo

𝒁𝒆𝒓𝒐 𝑻𝒘𝒐

Updated 3 months ago

0

Maybe i'm wrong, but if your upstream is 127.0.0.1:8080... why do you have in proxy_pass http://127.0.0.1:4435 ??

profile_photo

Braga aka Sl1mJ0e

Updated 3 months ago

The upstream points to the real service port.
In the wordpress nginx we use the safeline port that we choose when we were creating the "Application".
Its already fixed, the problem was the proxy_http_version

SafeLine WAF Domain Mismatch Error with WordPress Sites | SafePoint