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

I have a VPS with a number of PHP sites that are hosted with Apache. I am looking to launch my first Python site quite soon and - as advised in the documentation - would like to use a separate web server to host static content.

I don't really want to mess around with my existing sites and risk causing them to be down for any period of time, however I do have a secondary IP address which, so far I have not used.

Would it be possible to make nginx listen to this secondary address and then simply serve the static content via a subdomain (static.mydomain.com) through nginx?

Are there any complications I would be likely to encounter with this method or is it considered bad practice in any way?

Any advice appreciated.

Thanks.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Yes, it is possible to bind nginx to different IP by using listen directive. It is good practice to use nginx as server for static content or as http accelerator for apache server.

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.