Nginx configuration for trinidad-gem

171 views Asked by At

How to configure nginx with Trinidad? I did a lot of Googling, but no luck. Is there any resource for a sample configuration?

1

There are 1 answers

0
kares On

just google for proxy-ing with nginx - it's likely the same is with other Ruby servers e.g.

server {
    listen sample.com:80;
    server_name sample.com;
    root /home/trinidad/rails_app/current/;

    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:3000/;
    }
}

in Trinidad's configuration you might want to bind to 127.0.0.1 (just add address: 127.0.0.1)