Portal Home > Knowledgebase > Articles Database > Using Nginx and Apache together


Using Nginx and Apache together




Posted by JitsuDan, 05-03-2011, 09:10 AM
Hi, I have a lot of PHP sites running on a server with Apache. Now, I am just about to launch my first Django site. I have successfully got WSGI working with Apache and want to use Nginx to serve my static content. I have set Apache to listen on port 8080 and Nginx on port 80. Requests to my media URL are being served with Nginx and the Python files are being forwarded to Apache on port 8080, going through WSGI. What I want to know is, is there a simple way to keep all of my old sites going through Apache or do I need to create separate records in Nginx for each of my sites to forward them through to port 8080? I hope that makes sense (I'm quite new to this)! Any advice appreciated. Thanks.

Posted by quantumphysics, 05-03-2011, 02:20 PM
proxy_pass everything else and install rpaf on apache

Posted by aloycasmir, 05-03-2011, 02:27 PM
You can setup vhosts for specific domains in nginx virtual hosts configuration file for this purpose . Pass those websites directly to apache's port and let the rest be processed and proxied . You should place these specific lines above the rest of the virtual host lines in case you're using a wild card vhost . I Think that should make it work .

Posted by JitsuDan, 05-03-2011, 05:49 PM
Hi, Could you give me an example of this 'catch all' process? (sorry i'm new to nginx). Presumably I need to add something to /etc/sites-available/default rather than a specific domain?



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
VPS Reseller plants (Views: 633)
HELP....!! (Views: 582)