location /foo {
try_files $uri $uri.html $uri/index.html @proxy-foo;
}
location @proxy-foo {
proxy_passhttp://localhost:5000;
proxy_set_header Host $http_host;
}
この場合、通常の Plack アプリケーションだと/
がアプリケーションルートになっているので404になってしまう。よってapp.psgi
とは別に!perl
use strict;
use warnings;
use Plack::Builder;
use Plack::Util;
builder {
mount '/foo/' => Plack::Util::load_psgi('app.psgi');
}
の様な wrapper スクリプトを書く必要がありました。$ plackup --path /foo
と書くことで、自動的にマウントしてくれる機能が付きました。このブログを応援する
All contents of this site, unless otherwise noted, © 2005-2022 Yasuhiro Matsumoto, andrights reserved.
ご質問、お問い合わせはe-mailで