Skip to content

Instantly share code, notes, and snippets.

@xbklairith
Created March 11, 2017 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xbklairith/e809ff7e4f91748f203fb88f29e9f2e7 to your computer and use it in GitHub Desktop.
Save xbklairith/e809ff7e4f91748f203fb88f29e9f2e7 to your computer and use it in GitHub Desktop.
get base url from sinatra with nginx passenger app passenger_base_uri
#get base url from sinatra with nginx passenger app passenger_base_uri
base_url = "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}#{request.env['SCRIPT_NAME']}";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment