{"id":15661068,"url":"https://github.com/jeremy/rack-reproxy","last_synced_at":"2026-03-07T05:05:36.604Z","repository":{"id":66392372,"uuid":"4018471","full_name":"jeremy/rack-reproxy","owner":"jeremy","description":"Transparently proxy Rack responses from a backend URL. Great for private access to an internal service or to route authenticated requests through intermediate caching layers.","archived":false,"fork":false,"pushed_at":"2022-01-07T10:28:36.000Z","size":156,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T23:51:06.661Z","etag":null,"topics":["rack","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeremy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-04-13T17:29:38.000Z","updated_at":"2024-12-30T16:53:40.000Z","dependencies_parsed_at":"2023-06-28T17:15:32.140Z","dependency_job_id":null,"html_url":"https://github.com/jeremy/rack-reproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremy%2Frack-reproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremy%2Frack-reproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremy%2Frack-reproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremy%2Frack-reproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremy","download_url":"https://codeload.github.com/jeremy/rack-reproxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577117,"owners_count":21770735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rack","ruby"],"created_at":"2024-10-03T13:25:41.287Z","updated_at":"2026-03-07T05:05:36.556Z","avatar_url":"https://github.com/jeremy.png","language":"Ruby","readme":"Rack::Reproxy [![Build Status](https://secure.travis-ci.org/jeremy/rack-reproxy.png)](http://travis-ci.org/jeremy/rack-reproxy)\n=============\n\nAllow Rack responses to be proxied from a different URL. It's like\nRack::Sendfile, but for any HTTP backend.\n\nRack apps can return a `URI` as a response body (or an `X-Reproxy-Url` header)\nand we pass it upstream to Nginx/Apache/Lighttpd to serve.\n\nThis is an approach pioneered by MogileFS using perlbal to reproxy file\nrequests to an internal storage backend.\n\n\nProxing to an internal app: serving private files\n-------------------------------------------------\n\nRack::Sendfile can efficiently serve files from the local filesystem.\nBut that means you have to have your files NFS-mounted on all your app\nservers, and you have to know their physical paths.\n\nInstead, you can expose your file server as a private HTTP service and\nreproxy requests to it. Get rid of fussy NFS mounts and just stream files\nback from your internal server.\n\n\nProxying to yourself\n--------------------\n\nYou can reproxy requests back to your own app, too. This is useful when you\nyou'd like to HTTP-cache private, authenticated content. You can't put a\npublic HTTP cache in front of your app, but you can put it in the middle!\n\nYour app receives a request, authenticates, and proxies its own response\nvia an internal HTTP cache that's backed by... your app.\n\nNginx\n-----\n\nIn config.ru\n\n```ruby\nuse Rack::Reproxy::Nginx, location: '/reproxy'\n```\n\nNginx config\n\n    location /reproxy {\n      internal;\n      set $reproxy_url $upstream_http_x_reproxy_url;\n      proxy_pass $reproxy_url;\n    }\n\n\nApache with mod\\_reproxy\n------------------------\n\nIn config.ru\n\n```ruby\nuse Rack::Reproxy::Apache\n```\n\nApache config. Requires the [mod_reproxy](https://github.com/jamis/mod_reproxy) module.\n\n    \u003cLocation /\u003e\n      AllowReproxy on\n      PreserveHeaders Content-Type Content-Disposition ETag Last-Modified\n    \u003c/Location\u003e\n\n\nLighttpd\n--------\n\nIn config.ru\n\n```ruby\nuse Rack::Reproxy::Lighttpd\n```\n\nLighttpd config\n\n    proxy-core.allow-x-rewrite = \"enable\"\n\n\nRack\n----\n\nWait, what? Yeah, you can reproxy without doing an HTTP roundtrip by\nimmediately redispatching back to your own app. This becomes useful\nwhen you do something like reproxy through Rack::Cache or want to\nemulate your nginx/apache reproxies in dev/test with Rack only.\n\nIn config.ru\n\n```ruby\n# To proxy to self\nuse Rack::Reproxy::Rack\n\n# To proxy to a different Rack app\nuse Rack::Reproxy::Rack, app: SomeInternalApp.new\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremy%2Frack-reproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeremy%2Frack-reproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremy%2Frack-reproxy/lists"}