文章詳情頁
項目打包上傳配置完nginx后無法返回json數據
瀏覽:180日期:2024-06-26 15:30:37
問題描述



本來應該返回json數據,卻返回了index.html,項目在本地跑是可以的,但是發到服務器上后就出現了這樣的錯誤,求解
nginx配置
server { listen 80; server_name www.xxxx.cn; root /data/www/blog/; location / { try_files $uri $uri/ /index.html; } }
服務器的打包后目錄為static和index.html, 代理到打包后的index.html,所以為text/html
/etc/nginx/mime.types配置
type { text/html html htm shtml }
問題解答
回答1:看上面報錯,是你返回的不是一個正確的json,貼下你后端的吐數據的接口吧
相關文章:
1. boot2docker無法啟動2. docker-compose中volumes的問題3. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””4. docker容器呢SSH為什么連不通呢?5. java - SSH框架中寫分頁時service層中不能注入分頁類6. dockerfile - 為什么docker容器啟動不了?7. 關于docker下的nginx壓力測試8. node.js - antdesign怎么集合react-redux對input控件進行初始化賦值9. docker安裝后出現Cannot connect to the Docker daemon.10. nignx - docker內nginx 80端口被占用
排行榜

網公網安備