I need to set some server specific variables in a rails application that will run on at least two different servers. What is the best way to get the request's HTTP_HOST value in order to know what is the current server and set these variables accordingly? I'm using Apache 2 with Passenger.
Think you're looking for request.env["SERVER_ADDR"]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With