OLD | NEW |
| (Empty) |
1 #!/usr/bin/ruby | |
2 | |
3 require 'etc' | |
4 | |
5 Dir.chdir(File.dirname(__FILE__)) | |
6 ENV['RAILS_ENV'] ||= 'production' | |
7 ENV['GEM_HOME'] = "#{Etc.getpwuid.dir}/.gems" | |
8 ENV['GEM_PATH'] = "#{ENV['GEM_HOME']}:/var/lib/gems/1.9.1" | |
9 | |
10 require 'fcgi' | |
11 require_relative 'config/environment' | |
12 | |
13 class Rack::PathInfoRewriter | |
14 def initialize(app) | |
15 @app = app | |
16 end | |
17 | |
18 def call(env) | |
19 env.delete('SCRIPT_NAME') | |
20 parts = env['REQUEST_URI'].split('?') | |
21 env['PATH_INFO'] = parts[0] | |
22 env['QUERY_STRING'] = parts[1].to_s | |
23 @app.call(env) | |
24 end | |
25 end | |
26 | |
27 Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(Discourse::Application) | |
OLD | NEW |