在测试服务器上goapp serv
它工作,在appengine本身它被application/octet-stream覆盖.
我如何告诉appengine停止这样做?
Could not guess mimetype for home/fonts/FontAwesome.otf. Using application/octet-stream...
我的配置文件:
application: test version: 0 runtime: go api_version: go1 threadsafe: true handlers: - url: /home static_dir: home - url: /home/font/(.*\.woff) static_files: home/font/\1 upload: home/font/(.*\.woff) http_headers: Content-Type: application/font-woff - url: /home/font/(.*\.svg) static_files: home/font/\1 upload: home/font/(.*\.svg) http_headers: Content-Type: image/svg+xml - url: /home/font/(.*\.eot) static_files: home/font/\1 upload: home/font/(.*\.eot) http_headers: Content-Type: application/vnd.ms-fontobject - url: /home/font/(.*\.ttf) static_files: home/font/\1 upload: home/font/(.*\.ttf) http_headers: Content-Type: application/x-font-ttf - url: /home/font/(.*\.otf) static_files: home/font/\1 upload: home/font/(.*\.otf) http_headers: Content-Type: application/x-font-otf - url: /favicon.ico static_files: home/favicon.ico upload: home/favicon.ico - url: /documentation static_dir: documentation - url: /.* script: _go_app inbound_services: - warmup
Yves Junquei.. 25
我相信它在本地工作的原因是你的系统具有为/etc/mime.types中的.otf扩展名定义的必需的mime类型或等价物.
AppEngine可能没有那个.因此,您必须提供有关正确MIME类型的提示.看起来你正试图这样做,但你正在使用"http_headers".请尝试"mime_type":
- url: /home/font/(.*\.otf) static_files: home/font/\1 upload: home/font/(.*\.otf) mime_type: application/x-font-otf
我希望这对你有用.文档位于:
https://developers.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_Static_file_handlers
我相信它在本地工作的原因是你的系统具有为/etc/mime.types中的.otf扩展名定义的必需的mime类型或等价物.
AppEngine可能没有那个.因此,您必须提供有关正确MIME类型的提示.看起来你正试图这样做,但你正在使用"http_headers".请尝试"mime_type":
- url: /home/font/(.*\.otf) static_files: home/font/\1 upload: home/font/(.*\.otf) mime_type: application/x-font-otf
我希望这对你有用.文档位于:
https://developers.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_Static_file_handlers