Can I use the same Nginx installation as a reverse proxy (for apache+mod_wsgi) and use it to serve static content and PHP over a single IP address at the same time?

link|improve this question
I would try to ask this question on stackoverflow.com. There it's all about servers. I have a few questions on the subject. – Saif Bechan Aug 19 '11 at 5:05
You but you would need to run apache on a different port (ex 81) and forward traffic from nginx to apache on port 81. Plenty of info on the nginx site how to do that. – Yavor Shahpasov Aug 19 '11 at 18:54
feedback

migrated from webmasters.stackexchange.com Aug 19 '11 at 17:47

This question came from our site for pro webmasters.

2 Answers

Yes, you can use one nginx instance to serve both static content, dynamic content (by proxying to an FCGI or backend HTTP app server) and a reverse proxy. The configuration is straightforward and covered by the excellent documentation and examples available from http://wiki.nginx.org/.

link|improve this answer
feedback

Using different listen ports and redirecting incoming connections (for e. g., with firewall) properly.

link|improve this answer
Is it possible with a single instance of nginx only listening on port 80? – abarg Aug 19 '11 at 3:51
Define what 'single instance of nginx' is? No apache at all, or what? – poige Aug 19 '11 at 4:03
What I meant was a single process, sorry. Actually multiple processes would be fine, but all requests need to come from port 80 – abarg Aug 19 '11 at 4:39
— Well, in conclusion: there's nothing unusual in the scheme of nginx usage you had asked about. – poige Aug 19 '11 at 5:17
feedback

Your Answer

 
or
required, but never shown