Assume the network handles packets and you handle requests. Rate-limit by client address before anything reaches PHP or your application: in nginx, limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m; applied to login, search and checkout endpoints removes most cheap floods, and lowering client_header_timeout and client_body_timeout from their 60-second defaults to around 10 seconds starves slowloris-style attacks. Cache whatever can be cached. A flood against a page served from memory costs you little, while the same flood against an uncached database query takes the site down long before the network sees anything unusual in the bandwidth graph.
Keep the origin address out of sight if you rely on a reverse proxy. Port 25 is open on every VPS here, which is convenient, but a mail server on the same IP as your website writes that address into the headers of every message it sends, and one newsletter is enough for an attacker to go around the proxy. Send mail from a separate VPS. On the server itself, leave net.ipv4.tcp_syncookies = 1 in place (the default on current kernels) and drop every port you do not serve at the host firewall. None of this survives a flood larger than the uplink, which fills before your kernel sees a packet; that is the division of labour the table above describes.
A commercial CDN in front of the server adds a large layer-7 filter and is a legitimate choice. The large ones are mostly US companies, and they terminate your TLS and read requests in clear, which undoes part of the reason customers choose offshore hosting in Panama in the first place. Decide which risk you are managing before you add one. If your content draws hostile attention, plan on that attention arriving as packets too, and put these measures in place before launch rather than during the first incident.