{"id":21262794,"url":"https://github.com/michaelfranzl/no.php","last_synced_at":"2025-07-11T04:31:07.018Z","repository":{"id":15367846,"uuid":"77825488","full_name":"michaelfranzl/no.php","owner":"michaelfranzl","description":"Transparent reverse proxy written in PHP","archived":false,"fork":false,"pushed_at":"2022-03-14T23:10:32.000Z","size":27,"stargazers_count":139,"open_issues_count":2,"forks_count":44,"subscribers_count":12,"default_branch":"master","last_synced_at":"2023-11-07T21:22:19.890Z","etag":null,"topics":["php","reverse-proxy"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/michaelfranzl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-02T10:22:15.000Z","updated_at":"2023-11-04T01:22:14.000Z","dependencies_parsed_at":"2022-08-07T08:01:04.275Z","dependency_job_id":null,"html_url":"https://github.com/michaelfranzl/no.php","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelfranzl%2Fno.php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelfranzl%2Fno.php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelfranzl%2Fno.php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelfranzl%2Fno.php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelfranzl","download_url":"https://codeload.github.com/michaelfranzl/no.php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225674898,"owners_count":17506272,"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":["php","reverse-proxy"],"created_at":"2024-11-21T04:59:24.119Z","updated_at":"2024-11-21T04:59:24.628Z","avatar_url":"https://github.com/michaelfranzl.png","language":"PHP","readme":"# no.php\n\nTransparent reverse proxy written in PHP that allows you to not have to write PHP any more.\n\nThis short, single-file, 130-line PHP script is a simple and fully transparent HTTP(S) reverse proxy written in PHP that allows you to never have to use PHP again for a new project, if you feel so inclined, for example if you are forced to host on a fully 3rd-party-managed server where you can't do more than run PHP and upload files via FTP. The PHP script simply reads all requests from a browser pointed to it, forwards them (via PHP's curl library) to a web application listening at another URL (e.g. on a more powerful, more secure, more private, or more capable server in a different data center), and returns the responses transparently and unmodified.\n\nSupports:\n\n* Regular and XMLHttpRequests (AJAX)\n* All HTTP headers without discrimination\n* GET and POST verbs\n* Content types (HTTP payload) without discrimination\n* Redirects (internal redirects are rewritten to relative URIs)\n* Multipart content type\n* Cookies (with conversion of the backend domain to the no.php host)\n\nDoes not support (or not tested):\n\n* HTTP verbs other than GET and POST (but these are usually emulated anyway)\n* HTTP greater than version 1.1 (e.g. reusable connections)\n* Upgrade to websocket (persistent connections)\n\n\n## Usage illustrated by the standard example\n\nYou have a non-PHP web application (called the \"backend\") listening on `https://myapp.backend.com:3000` but due to constraints you must make it available on a shared hosting server called `https://example.com/subdir` which only supports PHP and can't be configured at all. On latter server, Apache (or Nginx, doesn't matter) will usually do the following:\n\n1. If a URI points to a .php file, this file will be interpreted\n2. If a URI points to a file that is not existing, a 404 status will be returned.\n\nUsing no.php, to accomodate the second case, all URIs of the proxied web app (including static files) must be appended to the URI `https://example.com/subdir/no.php`. For example:\n\n    https://example.com/subdir/no.php/images/image.png\n    https://example.com/subdir/no.php/people/15/edit\n    \nIf your backend app supports that extra `/subdir/no.php` prefix to all paths, you are all set and ready to use no.php. Then:\n\n1. Simply copy `no.php` into the `subdir` directory of example.com\n2. Change `$backend_url` in `no.php` to `\"https://myapp.backend.com:3000\"`\n3. Point a browser to `https://example.com/subdir/no.php`\n\n\nIn Ruby on Rails for example you must do a minimal adaptation to facilitate the mentioned URL prefix -- please consult the Ruby on Rails documentation for full details, but here is a hint:\n\n    ENV['RAILS_RELATIVE_URL_ROOT'] = \"/subdir/no.php\"\n\n    Rails.application.configure do\n      config.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT']\n    end\n\n    Rails.application.routes.draw do\n      scope path: ENV['RAILS_RELATIVE_URL_ROOT'] do\n        # routes here\n      end\n    end\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelfranzl%2Fno.php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelfranzl%2Fno.php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelfranzl%2Fno.php/lists"}