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.

Basically i am trying to setup nginx with apache but i want nginx to serve static content such as javascript, stylesheets, media files etc but i want php to be passed to apache listening on port 8080.

Using the following i can get nginx to redirect php requests to apache listening on port 8080

location ~ \.php$ {
proxy_pass         http:127.0.0.1:8080/;
}

But how can i tell nginx to serve all static data such as .css .js .flv. png .ico .gif .jpg etc.

share|improve this question

2 Answers 2

Are you sure you want nginx on windows? from http://nginx.org/en/docs/windows.html:

Version of nginx for Windows uses the native Win32 API (not the Cygwin emulation layer). Only the select() connection processing method is currently used, so high performance and scalability should not be expected. Due to this and some other known issues version of nginx for Windows is considered to be a beta version.

share|improve this answer

Add a new location directive which points to your static files:

location ~* \.(css|js|png|ico|gif|jpg)$ { 
   root path/to/static/folder
}

As for FLV, you'll want to read the HttpFlvModule article if you want to have seek. Otherwise, just add 'flv' into the extension pattern.

share|improve this answer

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.