Search code examples
nginxgruntjswebrick

Nginx node and WEBrick configuration


Let me preface this by saying that I have no idea what I'm doing.

Alright, with that out of the way, my question is this: I'm running Grunt's webserver to serve front-end files and I'm running webrick for the data api. Grunt proxies data requests to webrick using grunt-connect-proxy. In development, I've got the grunt server listening on port 9000 and webrick listening on 3000.

I'd like to get this workflow working with Nginx, but I'm not sure how to do it ... If there's anyone who knows how to set up an appropriate config file your help would be invaluable.


Solution

  • server {
        server_name example.com;
        location / {
            proxy_pass http://127.0.0.1:9000;
            proxy_set_header Host $host;
        }
    }
    

    Add any additional rules you need