I am reading but having hard time understand difference between the two. I am using Heroku for my apps and until now I was using NGINX to serve my content. I precompressed my static files to gzip and served them like that, turning off dynamic compression in NGINX config file.
Now I am learning about Cloudflare CDN. As I see it is also serving static content. Is there any point in using both NGINX and Cloudflare, what would be the benefits?
How does a flow of that goes when user visits the website?
Would it be:
End User -> Cloudflare DNS -> CDN -> NGINX -> Heroku
End User <- Cloudflare DNS <- CDN <- NGINX <- Heroku
Cloudflare would not exist without NGINX. “NGINX is core to what Cloudflare does. It is part of the foundational pieces of software we use.
Cloudflare has "outgrown" Nginx and ended up creating their own HTTP proxy stack. Cloudflare found that Nginx's worker process architecture was hitting drawbacks, particularly around CPU resources. Nginx also proved to be difficult to extend to their needs.
As Cloudflare has scaled we've outgrown NGINX. It was great for many years, but over time its limitations at our scale meant building something new made sense. We could no longer get the performance we needed nor did NGINX have the features we needed for our very complex environment.
NGINX is a high‑performance web server, load balancer, and proxy that our CDN network uses to deliver our customers' content as fast as possible. In the past few years, more high‑traffic websites have started using NGINX as their high‑performance server.
From, How does Cloudflare work?:
The Short Answer, Cloudflare protects and accelerates any website online. Once your website is a part of the Cloudflare community, its web traffic is routed through our intelligent global network.
In terms of differences, you can't directly compare Nginx with a CDN (a group of services including Nginx), you can create a CDN using Nginx.
Cloudflare does not serve static content itself. It only caches content originally served by some other server. You still need that other server -- known as your "origin server". You might still use nginx as your origin server. By putting Cloudflare in front of it, you can make your site faster and more secure, but Cloudflare does not replace your server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With