-
-
Save halorgium/e4337fdf7722a9e44e82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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