le_me
le_me

Reputation: 3419

change sinatras base url for redirects

if I use redirect to("/") in my sinatra app it alwasy redirects me to localhost. But I wan't it to redirect to my domain. How do I set the domain?

Upvotes: 0

Views: 411

Answers (2)

le_me
le_me

Reputation: 3419

Ok I finally got it:

in nginx.conf, in the location block insert:

proxy_set_header Host %YOUR_HOST%;

Upvotes: 0

user1480400
user1480400

Reputation:

Sinatra does not have a configuration specific for base url. It takes values populated (line 182-196) by your reverse proxy, load balancer, other Rack routers etc. You can try calling

redirect "/"

to see that works for you.

Upvotes: 1

Related Questions