简体   繁体   中英

Communication between two servers for a ddos challenge page?

I need to develop a challenge page much similar to the Cloudflare firewall challenge.

I know how to make the front end and the back end of the challenge app and I know how to set it up on the server.

The problem comes on how to implement it to the website which is on one server, while the challenge app is on another server. How should I make the communication between the servers? Both servers will be Ubuntu 16.4. Thank you all in advance.

I think it's better to solve this issue like cloudflare using nginx server.

  • Make an nginx reverse proxy with rate limit
  • if limit hit user will be redirected to error page
  • integrate your challenge app with the error page.

more about this configuration is here: https://serverfault.com/questions/645154/how-to-redirect-to-an-other-link-when-excess-request-limit-req-with-nginx

And How to use PHP in error pages is here: Nginx, PHP + FPM Custom Error Pages you can run this reverse proxy on third server or you can run it on the challenge app server.

make your domain points to the reverse proxy then make nginx config

 server {

        listen   80 default_server;
        server_name *.*;
        client_body_timeout 5s;
        client_header_timeout 5s;
        location / {
            proxy_set_header Host $host;
            proxy_pass http://00.00.00.00/; #replace with upstream ip
        }

}

you have to combine this with custom php error page

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM