Nginx CDN

We plan to build a cdn with up to six nginx reverse proxy.
But i got my mind complicated. Is tere any way to update all nginx configs at same time  ?
* we decide to use a shared folder to mount remote servers
* we just checked for the master / slave conf.
....etc.

We will glad for any advice
FireBallITAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
Use some configuration management software like puppet to maintain server farm.
Since you mention apache - use any of in-memory cache with NGINX for public documents, like javascripts.
Alexandre SimõesManager / Technology SpecialistCommented:
I think this is the perfect scenario for a Docker container with your NGinX base config.
It will make it easier to scale up or down as needed.

To handle the shared config you can use Zookeeper or Etcd.

Changing the configs in the centralized repository and and calling
service nginx reload

Open in new window

on all servers should do the trick with no downtime.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FireBallITAuthor Commented:
hello alexandre that softwares seems for apache, should them work on nginx too _?
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

gheistCommented:
It is just fles in different directory than /etc/httpd...
Alexandre SimõesManager / Technology SpecialistCommented:
Sure, Apache here stands only for the community that hosts the project, the Apache Software Foundation
btanExec ConsultantCommented:
Probably you will want to check this same experience in CDN building using Nginx too
sudo apt-get install nginx
Choose a folder where you want your asset folder to be: (/var/www/assets/). Then you can point Nginx to it. Create an Nginx config file:

vim /etc/nginx/sites-available/yourwebsite.com
And add these settings:

server {
  listen 80;
  server_name cdn.yourwebsite.com;

  location / {
    expires 90d;
    root /var/www/assets/;
  }
}
Also make sure you create a symlink in the sites-enabled folder.
http://idiallo.com/blog/creating-your-own-cdn-with-nginx
gheistCommented:
I'd start with nginx distribution of nginx (that replaces distribution nginx package with latest and greatest from nginx)
https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
Shalom CarmelCTOCommented:
Ehhm, let me be the devil's advocate here.
My daily business is CDN, all sorts and brands of CDN (www.globaldots.com). Twice a week I run CDN benchmarks either for customers or for internal comparison, checking cache performance, throughput and availability.
Now and then customers come with home brewed CDN. Based on Nginx, or Apache, or Varnish, or sometimes custom solutions.
Custom home brewed solutions are always inferior in performance, price and availability to commercial CDN services. To have a good CDN you need much more than caching Nginx. You need an extremely high knowledge of peering, DNS, server deployment, not to speak of perfect mastery of the caching technology and running a 24/7 NOC.

Please don't take my words as an insult. You obviously do not have all of the above qualifications, and I highly recommend that you use a commercial CDN, save money and sleep quietly.

The only reason to go your way is when your CDN is to serve only a very limited geographical area in a developing country, or on an enterprise internal LAN. Even then I recommend to get a commercial license of aiScaler or Varnish, who deal with a lot of your issues out of the box. If it is internal LAN/WAN then go get an F5 box or Replify.  

Sorry to cool you down :)
btanExec ConsultantCommented:
Just to share for F5 LTM for local device failover and HA appl level btw device sync failover group can be done while F5 GTM for "DNS" sort of failover largely from the site rather than device level. I believe they have sync group of the configuration of range of 16- 32 appliances.. other wise may even consider OpenDNS base on local limited geo availiability
FireBallITAuthor Commented:
Dear shalomc ,


     we have no need to use it in emergency. But we have 600+ servers 290.000+ hosting in our enviroment with 6 different isp connection. And perfect ddos protections with enterprise devices. like MX80 , SRX3600 , Ex4500 , Citrix , Happ .....etc.

    we have already 7/24 Noc.

    Now the main topic is we should learn in detailed way in time like how you learn ;) .And for ddos filters we already work with 8 different locations.   So now i need to go on talking about the question.

   But with your experinece if you help us i would be glad for that
gheistCommented:
I would move to apache event mpm before considering nginx
While you can cover close proximity better with close CDN, commercial CDN will do much better with faraway places like other side of globe (do you want to serve those very well?)
FireBallITAuthor Commented:
do you want to serve those very well?   I am not sure. But firstly we want to let it learn deeply how do they do it.

For ex. as you see in my old question we have searched for DDOS mitigation / protection for 1+ year . Then we do it a perfect product. Now we have paid for the protection unites nearly 1M $  +  

CDN is just an idea for now. Firstly we need to know mechanism perfectly and how do big companies do it
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.