0

I setup a custom nodejs service using the https://github.com/dotcloud/node-on-dotcloud . But now it seems like it doesn't have nginx. How to setup nginx for a custom nodejs service?

andr111
  • 2,982
  • 11
  • 35
  • 45
  • This is quite old. Any acceptable solutions? –  Jul 31 '12 at 13:57
  • 1
    I tried Andy's answer, but couldn't make it work (maybe I messed something up). So I ended up setting an empty PHP service with nginx.conf in the root that proxies all requests to my node.js service. – andr111 Jul 31 '12 at 22:02
  • Btw, is there any reason for using PHP service and not the static service? –  Aug 01 '12 at 12:23
  • No, I think there is no reason. I did it just because I found the answer on a forum where somebody used PHP service. I guess any service that has nginx would work. – andr111 Aug 01 '12 at 16:52
  • @bvukelic Were you able to make it work with a static service? – andr111 Aug 25 '12 at 01:43
  • No, actually, I had some problems with setting up Node.js so I gave up on dotCloud in the end. –  Aug 31 '12 at 16:38

1 Answers1

0

First, a cautionary statement: the dotCloud 'custom' service is still in beta. So the answer I give you now could change in the future.

When you create a 'custom' type nodejs service, your service container also has nginx available, but it is not running. To get nginx to run, you will need to:

  1. Add an nginx.conf file to the root of your application.

  2. Add a 'process' to your dotcloud.yml file to start up nginx:

    process: nginx -c your_configuration_file

where *your_configuration_file* is the full path to your nginx.conf

I hope that helps!

/Andy

Andy
  • 35,844
  • 6
  • 43
  • 50