Skip to content

Instantly share code, notes, and snippets.

@halorgium
Created April 18, 2009 12:25
Show Gist options
  • Save halorgium/e4337fdf7722a9e44e82 to your computer and use it in GitHub Desktop.
Save halorgium/e4337fdf7722a9e44e82 to your computer and use it in GitHub Desktop.
# This is a middleware to fix the Rack env hash issue with nginx passenger
class NginxPassengerFix
def initialize(app)
@app = app
end
def call(env)
# Very dodgy hax to correct the PATH_INFO
env["PATH_INFO"] = env["REQUEST_URI"].sub(/\?[^\?]*$/, "")
r = @app.call(env)
end
end
# In your config.ru
use NginxPassengerFix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment