After project packaging and uploading, nginx cannot be returned after configuring nginx.
巴扎黑
巴扎黑 2017-05-16 17:07:40
0
1
436

It should have returned json data, but instead returned index.html. The project can be run locally, but after sending it to the server, such an error occurred. Solution

nginx configuration

    server {
          listen       80;
          server_name  www.xxxx.cn;
          root /data/www/blog/;
          location / {
                  try_files $uri $uri/ /index.html;
          }
    }

The packaged directories of the server are static and index.html, and the packaged index.html is proxied, so it is text/html

/etc/nginx/mime.types configuration

type {
  text/html html htm shtml    
}
巴扎黑
巴扎黑

reply all(1)
仅有的幸福

Look at the error reported above. It means that what you returned is not a correct json. Please post the interface of your backend to spit out data

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template