Mojolicious::Plugin::ProxyPassReverse::SubDir - Mojolicious Plugin for reverse proxy and sub-directory environment
## 1. Basic # Mojolicious $self->plugin('ProxyPassReverse::SubDir'); # Mojolicious::Lite plugin 'ProxyPassReverse::SubDir'; ## 2. For Custom HTTP Header (Default: X-Forwarded-Host) # Mojolicious $self->plugin('ProxyPassReverse::SubDir' => { header => 'X-Forwarded-Your-Custom-Header', }); # Mojolicious::Lite plugin 'ProxyPassReverse::SubDir' => { header => 'X-Forwarded-Your-Custom-Header', }; ## 3. For Custom HTTP Header Value # Mojolicious $self->plugin('ProxyPassReverse::SubDir' => { header => 'X-Forwarded-Your-Custom-Header', value => 'On', }); # Mojolicious::Lite plugin 'ProxyPassReverse::SubDir' => { header => 'X-Forwarded-Your-Custom-Header', value => 'On', }; ## 4. For Custom Sub-Directory Depth # Mojolicious $self->plugin('ProxyPassReverse::SubDir' => { depth => 2, # Ex) http://example.com/foo/bar => http://example.com:3000/ }); # Mojolicious::Lite plugin 'ProxyPassReverse::SubDir' => { depth => 2, # Ex) http://example.com/foo/bar => http://example.com:3000/ };
Mojolicious::Plugin::ProxyPassReverse::SubDir is a Mojolicious plugin to easily support reverse proxy and sub-directory environment.
Mojolicious::Plugin::ProxyPassReverse::SubDir inherits all methods from Mojolicious::Plugin and implements the following new ones.
$plugin->register(Mojolicious->new);
Register plugin in Mojolicious application.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
Shingo MURATA <murata@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mojolicious::Plugin::ProxyPassReverse::SubDir, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::ProxyPassReverse::SubDir
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::ProxyPassReverse::SubDir
For more information on module installation, please visit the detailed CPAN module installation guide.