質問

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.

役に立ちましたか?

解決

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

他のヒント

Visit https://github.com/drewzboto/grunt-connect-proxy. There has a step by step example. Paste your code.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top