google appengine的yaml文件,配置說明

application: myapp  # 你的google app id html

version: 1          # 版本 正則表達式

runtime: go         # 運行時語言 api

api_version: go1    # API的版本 緩存


default_expiration:  1d 2h 3m 4s # 可選的,若是靜態資源沒有設置expiration,則會使用該項 app


handlers:                   # 分發器 網站

- url: /stylesheets         # 擴展的posix regex表達式,能夠使用\W, \w, \S, \s, \D, \d ui

  static_dir: stylesheets   # 靜態目錄 google

  mime_type: xxxx           # 可選的,若是設置了,就會指定response的類型 url

  expiration: 1d 2h 3m 4s   # 可選的,表示靜態資源應被客戶端緩存的時間 spa


- url: /(.*\.(gif|png|jpg))$

  static_files: static/\1           # url捕獲的分組是能夠用的(\1)

  upload: static/.*\.(gif|png|jpg)$ # 可選的,upload用來限制static_files可訪問的文件

  application_readable: true        # 可選的,爲真時,腳本能夠訪問該文件

  http_header:                      # 可選的,表示能夠設置response的header

    Access-Control-Allow-Origin: *  # 可選的,設置爲*,全部網站均可以訪問myapp.appspot.com的資源

                                    # 設置爲http://mygame.appspot.com,則只有該站可訪問資源


- url: /.*

  script: _go_app   # 表示由腳本處理該url

  secure: optional  # 可選的,此爲默認值,http和https均可以成功訪問站點

          never     # https會被重定向到http協議下的統一站點

          always    # http會被重定向到https協議下的統一站點

  login: optional   # 可選的,此爲默認值,不須要登陸

         required   # 須要登陸才能訪問,不然執行auth_fail_action

         admin      # 必須是管理員賬戶才能訪問,未登陸執行auth_fail_action,返回401

  auth_fail_action: redirect        # 可選的,此爲默認值,重定向到google登陸頁面

                    unauthorized    # 返回401

error_handlers:     # 可選的,設置錯誤頁面

  - file: default_error.html    # 默認的錯誤頁面


  - error_code: over_quota      # 指定錯誤碼

    file: over_quota.html       # 該錯誤碼的頁面

skip_files:         # 表示應用目錄中匹配下列正則表達式的文件都不須要上傳

- ^(.*/)?#.*#$

- ^(.*/)?.*~$

- ^(.*/)?.*\.py[co]$

- ^(.*/)?.*/RCS/.*$

- ^(.*/)?\..*$


還有一些其餘信息,請參考google app engine sdk

相關文章
相關標籤/搜索