Nirvana Javascript : Using a Reverse Proxy
In some environments, it might be desirable to deploy a Nirvana web application on a dedicated web server other than the Nirvana Realm, and to serve content to clients through a single, reverse proxy server.
Here, we outline an example configuration where an Apache server is used for reverse proxying content hosted on a second internal Apache server (running on an arbitrary port, say 80), and for reverse proxying all communication with the Nirvana Realm on an interface on another arbitrary host and port (say 8000):
# Example Apache Reverse Proxy Configuration # All URLs starting with /myapp/ will be reverse proxied to # another Apache instance , which runs on apachehost port 80: ProxyPass /myapp/ http://apachehost:80/ ProxyPassReverse /myapp/ http://apachehost:80/ # All URLs starting with /nirvana/ will be reverse proxied to # the Nirvana server file plugin on nirvanahost port 8000: ProxyPass /nirvana/ http://nirvanahost:8000/ ProxyPassReverse /nirvana/ http://nirvanahost:8000/ # All URLs starting with /sv/ will be reverse proxied to # the Nirvana server on nirvanahost port 8000: ProxyPass /sv/ http://nirvanahost:8000/sv/ ProxyPassReverse /sv/ http://nirvanahost:8000/sv/ ProxyPassReverseCookiePath /sv/ /sv
In the above example, it is assumed that the application is:
- located at http://apachehost/myapp/
- configured to use the Nirvana JavaScript libraries at http://reverseproxyhost/nirvana/ (ultimately hosted on a file plugin at http://nirvanahost/)
The above configuration should, of course, be modified to suit your own architecture.
