| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Transparent reverse proxy written in PHP that allows you to not have to write PHP any more.
This 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.
Supports:
Does not support (or not tested):
You 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:
Using 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:
https://example.com/subdir/no.php/images/image.png https://example.com/subdir/no.php/people/15/edit
If your backend app supports that extra /subdir/no.php prefix to all paths, you are all set and ready to use no.php. Then:
In 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:
ENV['RAILS_RELATIVE_URL_ROOT'] = "/subdir/no.php"
Rails.application.configure do
config.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT']
end
Rails.application.routes.draw do
scope path: ENV['RAILS_RELATIVE_URL_ROOT'] do
# routes here
end
end
| Back | FazBrowse Home | New Git URL |