Author image Shingo Murata

NAME

Mojolicious::Plugin::ProxyPassReverse::SubDir - Mojolicious Plugin for reverse proxy and sub-directory environment

SYNOPSIS

  ## 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/
  };

DESCRIPTION

Mojolicious::Plugin::ProxyPassReverse::SubDir is a Mojolicious plugin to easily support reverse proxy and sub-directory environment.

METHODS

Mojolicious::Plugin::ProxyPassReverse::SubDir inherits all methods from Mojolicious::Plugin and implements the following new ones.

register

  $plugin->register(Mojolicious->new);

Register plugin in Mojolicious application.

SEE ALSO

Mojolicious, Mojolicious::Guides, http://mojolicio.us.

AUTHOR

Shingo MURATA <murata@cpan.org>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.