[英]need help on nginx configuration for nodejs api
我的節點 api 從端口 1337 開始並且工作正常。 如果我瀏覽localhost:1337
我的 api nothing
都不返回,如果我瀏覽localhost:1337/products
我的 api 實際上工作正常並將我的產品列表返回為 ZEED8D85B888A6C0153834240885ZEE6。 現在服務 nginx 已安裝並配置好,以將localhost:1337
反向代理到localhost
所以在打開localhost
后它以某種方式工作並且像以前一樣nothing
,但是如果我再次嘗試瀏覽localhost/products
nothing
,也不關心products
。
我剛剛發現了問題。 在 nginx 默認配置中刪除了部分location /api/
中的所有內容,只需復制proxy_pass http://localhost:1337/;
孤獨。 它工作正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.