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