ポートでExpress APIを使用する45510764714のEmberアプリがあります。私は私のAPIにサーバー、ディレクトリ変更にSSH、およびnode server
を実行し、この作品Emberアプリケーションをデジタルオーシャンにどのように配備できますか?
location/
{
proxy_pass http://localhost:4500;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
:私はまた、nginxのsites-available
ファイルを編集した
/var/www/my-api-domain.com/public_html/
:私はに私のAPIをアップロードしています!私は、ブラウザで私のIPを訪問するとき、私は私のAPIが正しく動作して参照してください。
私はその後、ローカルember build -prod
を実行し、その結果得られるdist
フォルダの内容をアップロード:
/var/www/my-ember-domain.com/public_html/
私はもう一度nginx sites-available
を次のように更新しました:
location /ember
{
proxy_pass http://localhost:4200;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
今何?通常、サイトをローカルで実行すると、ember server
を実行しますが、dist
の結果ファイルは大きく異なって見え、サーバーにはember cli
がインストールされていません。私がそれについて読むと、それは適切なアプローチではないようです。
ブラウザでhttp://159.203.31.72/emberを押すと、nginx 502 Bad Gateway
が表示されます。 Emberアプリケーションをどのように提供できますか?