logo
0
1
Login

EdgeOne Server

给 EdgeOne 边缘函数增加类似 Nginx 的 root、try_files 能力

环境变量配置

默认模式:

环境变量类型默认值示例值必填
EOS_ROUTE_TYPEstring
EOS_ROOTstringhttps://www.abc.com
EOS_INDEXstringindex.html
EOS_DEFAULT_CACHE_CONTROLstringpublic, max-age=3600
EOS_CACHEon | offon

web模式:

环境变量类型默认值示例值必填
EOS_ROUTE_TYPEstringweb
EOS_ROOTstringhttps://www.abc.com
EOS_INDEXstringindex.html
EOS_DEFAULT_CACHE_CONTROLstringpublic, max-age=3600
EOS_CACHEon | offon

cos模式

环境变量类型默认值示例值必填
EOS_ROUTE_TYPEstringcos
EOS_INDEXstringindex.html
EOS_DEFAULT_CACHE_CONTROLstringpublic, max-age=3600
EOS_CACHEstringon
EOS_COS_SECRET_IDstring
EOS_COS_SECRET_KEYstring
EOS_COS_BUCKETstring
EOS_CACHEstring

cos web模式

环境变量类型默认值示例值必填
EOS_ROUTE_TYPEstringcos_web
EOS_INDEXstringindex.html
EOS_DEFAULT_CACHE_CONTROLstringpublic, max-age=3600
EOS_CACHEstringon
EOS_COS_SECRET_IDstring
EOS_COS_SECRET_KEYstring
EOS_COS_BUCKETstring
EOS_CACHEstring

cnb模式:

环境变量类型默认值示例值必填
EOS_ROUTE_TYPEstringcnb
EOS_ROOTstringhttps://cnb.cool/xiong/eo-server/-/git/raw/main
EOS_INDEXstringindex.html
EOS_DEFAULT_CACHE_CONTROLstringpublic, max-age=3600
EOS_CACHEon | offon

cnb web模式:

环境变量类型默认值示例值必填
EOS_ROUTE_TYPEstringcnb_web
EOS_ROOTstringhttps://cnb.cool/xiong/eo-server/-/git/raw/main
EOS_INDEXstringindex.html
EOS_DEFAULT_CACHE_CONTROLstringpublic, max-age=3600
EOS_CACHEon | offon

补充说明:

  1. cos模式下,会删除响应头中的Content-Disposition,x-cos-* 信息;
  2. cnb模式下,会删除响应头中的Content-Security-Policy,将Cache-Control替换成默认值;
  3. cnb模式下,会将一些常见的资源类型的Content-Type修改成正确的值;
  4. 如果响应中未包含Cache-Control,将会添加默认Cache-Control

About

给 EdgeOne 边缘函数增加类似 Nginx 的 root、try_files 能力

edgeonenginxvuetry_filesexample
456.00 KiB
0 forks1 stars1 branches2 TagREADMEMIT license
Language
TypeScript74.7%
Markdown16.9%
License4.3%
HTML2.2%
Others1.9%