2

I have my website built with django running on an apache server and I want to install nginx for static file serving. Do you think there is any considerable difference if i put nginx on port 80 and proxy requests to apache, or leave apache on port 80 and proxy requests to nginx. Why I ask is because I would rather leave apache on 80 because I have cpanel on my webserver and changing apache port would be more complicated.

0

1 Answer 1

1

Create an IP alias on your primary interface, bind httpd to the main address, and bind nginx to the alias address.

6
  • Is there any advantage to doing this? I know I can use nginx as a front-end and I believe I can use apache as front-end also and nginx serving static files on another port and I could just proxy requests from apache to nginx. Another IP address would just cost more. Aug 24, 2010 at 14:38
  • 1
    The advantage is that you wouldn't have to proxy the requests. Proxying has a non-zero cost itself. Aug 24, 2010 at 21:16
  • How can I do this? I mean don't I have to use something la proxy just to the other ip on port 80? Can you please give me a line doing this, so I could understand how you do it? Aug 25, 2010 at 10:27
  • Add a second DNS entry (e.g. static.example.com) pointing to the alias address, then change the media URL to that name. Aug 25, 2010 at 10:41
  • 1
    ah, that would Imply I go through all sources and change the domain for everything that is static, like having it on another server Aug 25, 2010 at 11:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .