Call us Toll-Free:
Email us

Using Nginx as a Reverse Proxy to IIS

Adrian Singer, November 4, 2010
We were recently approached by a client who's using a legacy Content Management system running on Microsoft IIS that is becoming painfully slow, hurting their business.

The system was not keeping up with their traffic.

Typically, in a situation like this, we would recommend re-architecting the application, piece by piece, replacing IIS with LAMP and optimizing database access.

In this case, the client was low on budget and didn't want to make too many changes. They were looking for a quick fix.

Following careful review of their .asp application, it became clear we're dealing with a chaotic buggy system and that we would have to cut deep, if we want to optimize existing code.

So we decided to go with a different approach.

Keep everything as is and use Nginx to reverse-proxy all incoming requests.

What is a Reverse Proxy?

A Reverse Proxy is a web server that handles all incoming requests from end-users, caching, load balancing and communicating with your back end primary servers as necessary.

IIS is slow. Nginx is super fast.

If we can't rewrite the code, let's have Nginx handle all traffic, connect to IIS internally and then cache the response from IIS, so that future requests can be fulfilled without ever hitting IIS.

The idea is to switch 1 million users downloading an image from IIS, with those users downloading everything from Nginx directly. Nginx is faster, light weight and scales easily.

Why Nginx?

Whenever we setup reverse proxies, one of our favorite options is Squid.

Squid has been around for a long time, very easy to setup and provides a good reverse-proxy caching solution.

In this case however, incoming requests required further logic before a request could be routed to IIS. Nginx is just as fast and offers greater flexibility by letting us use PHP.

Setting up

We provisioned a new dedicated server for the client and installed Nginx with PHP-FPM.

Analyzed all possible requests the IIS system was handling. They were all HTTP_GET requests, with varying parameters. IIS handled several vhosts, so we had to properly handle and

Configured Nginx to rewrite all requests for files that did not exist, to go to a notfound.php script:

In notfound.php, we would connect to IIS to retrieve the image / static page / dynamic content, then save it locally.

The IIS system served different content based on the user's ip address and origin, so we had to take that into account when saving file names. (/us/google/welcome.gif vs /canada/yahoo/welcome.gif)

Going live

After testing everything locally, we had the client update their DNS, sending all traffic to Nginx instead of IIS.

The impact on performance has been very noticeable.

IIS CPU utilization went down from 70% to below 5% at all times and Nginx was barely breaking a sweat, handling the majority of the requests locally, reverting to IIS only when presented with a new combination of parameters that was never seen before.

We later developed a simple way to "expire" content on Nginx so that whenever the client updated the IIS Content Management System, the changes would propagate properly.

There is one aspect of this solution that is still lacking and worth mentioning. In the event of a sudden burst of new requests with never-seen-before parameters, the current implementation will revert all requests to IIS until files are created locally. A better approach would be to queue requests for new content, avoiding hitting IIS more than once when there's a sudden burst of new requests.

Implementing a RabbitMQ/Cassandra queue for new requests would be the next step here, so we can avoid an initial slowdown when hit with a burst of new requests.

In Conclusion

SPI engineers came up with a quick fix, that didn't involve any changes to the original application and made a huge impact on throughput and the number of concurrent connections the service can handle.

If you're dealing with massive traffic and you're not using Nginx yet, you owe it to yourself to take it for a spin.

View 3 Comment(s)

Scaling in the real world

Mike Peters, August 31, 2010
In our ongoing journey to deliver faster, more reliable shopping carts, email marketing and hosting solutions, we're always on the lookout for new technologies and techniques to deal with a lot of data.

I'd like to share a few presentations we recently came across, that talk about scaling in the real world:

* MySpace: Massive scaling a .Net website with the Microsoft Robotic Studio
* Twitter: Big Data in Real-Time at Twitter
* Scale at Facebook
* Yahoo: Selectively Materializing User's Event Feeds
* Four Kitchens: Scalable queuing with flexible service levels
* Cassandra at Mahalo
* Cassandra at CloudKick

Magnetic Sponsoring giving away an Audi R8

Kate Richards, March 30, 2010
When it comes to Product Launches, we've seen our share of crazy affiliate giveaways over the years...

From vacation packages, gadgets, show tickets, waterboats, to 27" iMacs with the recent ShoeMoney System product launch SPI orchestrated two months ago.

But this one trumps them all.

Our good friends at Magnetic Sponsoring, launched "What's Working Now" yesterday, giving away an Audi R8 as the giveaway prize for their #1 affiliate!

Check out this video:

We're honored to be working with Mike Dillard, Matt Crystal, TJ and the rest of the gang at Magnetic. Pay close attention to what they're doing.

For more information about becoming a "What's Working Now" affiliate go to

You can learn all about the "What's Working Now" product at

Were you just banned from Google Adwords?

Mike Peters, December 4, 2009
If you're doing any PPC affiliate marketing, chances are you've heard what's been going on these last 3 days...

Google just completed another round of banning PPC affiliates, providing no information on the cause, other than a canned email.

Unlike a "Google Slap" which is a temporary increase of bid-prices due to low quality-scores, a "Google Ban" is permanent and prevents you from ever advertising on Google using your credit-cards or ip-addresses that you previously used with Google.

We've heard from hundreds of PPC affiliates who got banned on this recent round. Search Engine Marketing forums are exploding with angry marketers who've lost their entire business over-night.

Is affiliate marketing on Google Adwords dying a slow death? This remains to be seen.

The recent ban wasn't limited to affiliates running rebill offers but rather a mix of accounts promoting anything from Clickbank products, CPA offers, poor landing pages, etc.

If you're a PPC marketer, you're going to be forced to evolve or close shop.

Remember this -

Google accounts for about 15% of the traffic available online.

Look into other avenues such as Email Marketing, PPC on other engines such as Yahoo and MSN, Media buys, Product launches and Social media marketing, as a way of driving traffic to your offers.

View 3 Comment(s)
A Product Launch is the process of building anticipation and emphasizing scarcity in a hungry market, towards the release of a new product / service, positioned to have the potential to make a significant impact on the target customer's life.

In the Internet Marketing world, Product Launches are powerful marketing vehicles used by Information-Marketers to drive a massive amount of traffic on a specific day ("Launch day"), with the goal of converting the wave of anonymous traffic into qualified leads and then paying customers.

For the past 5 years, SPI has been instrumental in orchestrating some of the largest most-successful product launches online, working with leading information marketers on applying time-tested techniques to generate hundreds of millions of dollars in product revenues.

Some of the recent product launches we handled include ListBuilding, GoogleCashDetective, 7FigurePPCSecrets, LaunchTree, AffiliateClassroom, PPCClassroom, DirectResponseMarketing.

Why does it work

Product Launch Marketing works so well because they build on two fundamental human traits:

#1. Herd Mentality - Follow the leaders
In the weeks building to the launch, opinion leaders and peers within your industry, will all glorify how great this product is going to be and why you absolutely must have it.

#2. Scarcity - Desire to want what we can't have
Using a limited number of units, fixed close date, early-bird discounts, one-time-offers and other tactics, the company will build the impression you must act fast or lose the opportunity to own the product forever.

Examples of great well-planned product launches: The iPhone, "The Secret" DVD, StomperNet 3.0, Gary Vaynerchuk's CrushIt book.

In Numbers

A typical Internet Marketing Product Launch these days, yields $1m (One Million Dollars) on launch day, followed by $200k in monthly residual payments from a continuity program.

It is far easier to convince 2,000 prospects to pay $99 a month, than it is to direct-sell a few large accounts in order to generate the equivalent of $200k in monthly revenues.

1,000 users paying $99 a month = $100k a month
2,000 users paying $50 a month = $100k a month
4,000 users paying $25 a month = $100k a month

50% of the revenues are often paid back to affiliates.
20% is the average three-months drop-out rate.

The SPI Product Launch Program

With the "Product Launch Program", we are now helping dozens of companies in various industries, capitalize on this phenomenal marketing strategy.

The SPI Product Launch Program, is not a how-to tutorial, or an online course.

This program is a joint-venture between you and SPI, whereby our company will work with you, hands-on, on every aspect of your product launch in a joint effort to make it a big success.

What you can expect from SPI, during this process:

* Hands-on consulting
* Introduction to leading information-marketing affiliates
* Access to case studies, analytics and proven tactics, used by leading information marketers
* Access to live front-end and back-office systems, so that you can learn what works best
* Professional services: Landing page design, Hosting, Affiliate system, Payment solutions
* PLR: Videos and mp3 files to complement your member's-only content
* Membership system integration (Wordpress+plugin / aMember / SPI)
* Load testing, to ensure your setup can handle launch-day traffic
* Affiliate emails autoresponder kit
* Corporate address, Call center, Help desk
* Ongoing Software development / website customizations / graphic design

Application Process

Our success over the years has made this service very popular. Committed to maintaining our strong reputation, SPI dedicates a lot of resources to every individual product launch we are involved with.

Unfortunately we cannot blindly accept new clients into this program.

Please contact your account manager (or email us here) for details on how to apply.
« Previous Posts

About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions