문제

How do I map www.somesite.com/api(.*) to www.somesite.com/$1:9000? (I need to map /api to Play framework application running @ port 9000)

I did the following:

$HTTP["url"] =~ "^/api" {
    proxy.server = ( "" =>
    ( ( "host" => "127.0.0.1", "port" => 9000 ) ) )
}

This gets me to somesite.com/api:9000 when I go to somesite.com/api, and I get "Action not found: For request 'GET /api'"

도움이 되었습니까?

해결책

It is easily accomplished using Nginx:

    location /api/ {
            rewrite   ^/api(/.*)$ $1 break;
            proxy_pass http://localhost:9000;
    }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top