iT邦幫忙

0

Nuxt使用Nginx做反向代理,request很慢

https://ithelp.ithome.com.tw/upload/images/20210914/20141956oGr5YdKSWf.png

執行npx create-nuxt-app建立的樣本,
nginx配置依照範例https://nuxtjs.org/docs/2.x/deployment/nginx-proxy ,
回應時間長達2秒。

P.S.試過不透過nginx,直接訪問nuxt,回應時間是正常的(毫秒級)

對於nginx和nuxt都不算熟,是否有高手能解答,謝謝。

obarisk iT邦研究生 2 級 ‧ 2021-09-16 07:47:53 檢舉
重點在cache?

先把 cache 關掉看單純 proxy 的狀況

剩下就只能看 log 了口日
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
nlstudio
iT邦新手 2 級 ‧ 2021-09-14 13:34:38
haha1230 iT邦新手 5 級 ‧ 2021-09-14 14:25:08 檢舉

log有這個錯誤訊息,
[error] 47916#34012: *775 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /_nuxt/89d51e3.js HTTP/1.1", upstream: "http://[::1]:3000/_nuxt/89d51e3.js", host: "localhost", referrer: "http://localhost/"

不知道如何解決

我要發表回答

立即登入回答