Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a following deployed scenario.

1x nginx as frontserver for gzip and ssl ofload serving all request to the same server haproxy service listening on 127.0.0.1:8000 to do loadbalancing for three backend IIS webservers.

Now I would like to move all the static content from my backend IIS server (css, jpg, png, js...)to one or two backend Nginx servers, to release working load of IIS.

I guess I have to put another rule for static content on nginx to send to haproxy ACL to forward the requests to 2 or 3 backend nginx servers.

Anyone with the same scenario?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

I found the answer myself. nginx frontend won't do anything. I will use haproxy to do the acl routings...

# Static content
acl url_static path_beg /javascripts /stylesheets /images
acl url_static path_end .jpg .jpeg .gif .png .ico .pdf .js .css .flv .swf
acl host_static hdr_beg(host) -i static0. static1. static2. static3.

use_backend static if host_static or url_static

# Default to dynamic content
default_backend dynamic
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.