Switching to nginx for a site, one issue I'm having is serving up static json files.
I added to the mime types:
application/zip zip;
...
application/json json;
...
and restarted but it tried serving it up as a download (ie http://domain.com/json-tmp/locations.json
). What else would I need to configure?
thx
I had to add
application/json json;
in /etc/nginx/mime.types
and restart nginx to make it work.
I know this post is quite old but adding application/json mime type to nginx configuration file plus restarting the server should work.
When you request the json file try to debug the response header and check if the Content-Type header was successfully changed to application/json.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With