2017-05-16 48 views
0

我有一個運行在端口45510764714​​上的Ember應用程序,它使用端口號爲4500的Express API。我已經上傳了我的API:如何在Digital Ocean上部署Ember應用程序?

/var/www/my-api-domain.com/public_html/

我還編輯nginx的sites-available文件:

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

我SSH到服務器,目錄更改爲我的API,並運行node server這個作品!當我訪問我的IP在瀏覽器中,我看到我的API正常工作:

http://159.203.31.72

我然後跑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應用程序?

回答

相關問題