0

私は現在、nginxによって提供される送信デーモンWeb UIを持っています

server {
    listen       2324;
    server_name  torrent.example.com;
    location /rpc {
        proxy_pass  http://127.0.0.1:9091/transmission/rpc;
    }
location /transmission {
        proxy_pass  http://127.0.0.1:9091/transmission;
    }
location / {
        proxy_pass  http://127.0.0.1:9091/transmission/web/;
    }
}

https://github.com/stormpath/stormpath-express-sampleこのダッシュボード/ユーザー インターフェイスを介してこのページを表示しようとしています

routes/index.js に私が持っている

router.get('/torrent', function (req, res, next) {
if (!req.user || req.user.status !== 'ENABLED') {
return res.redirect('/login');
}
var newurl = 'http://127.0.0.1:2324'
 request(newurl).pipe(res)
});

/torrent に移動すると html が表示されるが、images/css/js が表示されない

どうもありがとう

4

3 に答える 3

0

わかりましたので、html / cssで進歩しました。送信インターフェイスをエクスプレスルートに移動し、htmlをjadeにインポートしましたが、新しい問題が発生しています

/torrent ページをロードすると、Web コンソールに表示され、ルートを作成した /rpc にリクエストが送信されます

router.get('/rpc|/rpc/', function (req, res) {

var newurl = 'http://127.0.0.1:9091/torrent/rpc/'
 request(newurl).pipe(res)
});

しかし、router.get を router.post に変更すると、404 エラーが発生します。405 エラーが発生します。

送信から409エラーを削除したので、これは機能するはずです

于 2014-07-25T01:49:20.463 に答える
0

私は問題を解決しました

送信 index.html を jade テンプレートにインポートしました /torrent をルーティングしてそのテンプレートをレンダリングし、/rpc|/rpc/ の新しいルートを作成して、バックエンドの送信デーモンへのポスト リクエストを実行しました /js/ も変更しましたremote.js を使用して、atchual ドメインで RPC._Root を探します

于 2014-07-27T10:27:23.190 に答える