title: How to configure Nginx for different subdomains via different ports?
body: <p>I've struggled for couple of weeks on this configuration.What I want to achieve can be listed as follows.</p>
  
  <p>1.I registered a domain not long ago.And I've set up some web service on my VPS,such as a blog,a forum and Owncloud. Now I want to configured the Nginx so that I can run all the service on one VPS and one IP address. In order to run owncloud,I have to modify the <code>/etc/php5/fpm/pool.d/www.conf</code>to <code>listen = 9000</code>.In this case,I can only get one service (Owncloud)function,because if I want to run the forum I must uncomment the <code>listen = /var/run/php5-fpm.sock</code>.What's more,I've tried to uncomment both of them,Nginx showed 502 afterwards.</p>
  
  <p>2.I'm using Hexo as my blog.When I start the server,I can access into my blog on IP:4000.So I wonder if I could run my blog server on background and edit the posts online via a subdomain which has been redirected to port 4000.If it's possible,should I modify the <code>nginx.conf</code> or add something in <code>sites-available</code>?</p>
  
  <p>3.Can I deploy different web services on different subdomain?Which file is to modify?It's said that I can achieve this by using reverse proxy?</p>
  
  <p>Sorry for the pathetic English and expression.Thanks in advance.</p>