app.yaml は常に存在し、デフォルト モジュールに対応している必要があります。モジュールは、Google 開発者コンソール -> appengine -> バージョン (モジュールである必要があります) で確認できます。各モジュールには多数のバージョンが含まれる場合があります。
例: アプリケーション ファイル (php ファイルのみ) と静的ファイル (その他すべて) を異なるモジュールから提供するには、次の app.yaml および xml.yaml ファイルを参照してください。
app.yaml:
application: viewneo-eu
version: pro # production
runtime: php
api_version: 1
threadsafe: true
instance_class: F4
automatic_scaling:
min_idle_instances: 1 # one instance idleing forever
max_idle_instances: 4 # 4 x 50 = 200 max requests
min_pending_latency: 10ms # wait at least, before launching a new instance
max_pending_latency: automatic # after this time, create a new instance
max_concurrent_requests: 50
default_expiration: "0m"
handlers:
- url: /(.+)?/?
secure: always
script: build/mod_rewrite.php
- url: /.*
secure: always
script: build/mod_rewrite.php
xml.yaml:
application: viewneo-eu
module: xml
version: pro
runtime: php
api_version: 1
threadsafe: true
instance_class: F1
automatic_scaling:
min_idle_instances: 1 # one instance idleing forever
max_idle_instances: 4 # 4 x 50 = 200 max requests
min_pending_latency: 10ms # wait at least, before launching a new instance
max_pending_latency: automatic # after this time, create a new instance
max_concurrent_requests: 50
default_expiration: "0m"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
static_files: static/html/\1
upload: static/html/(.*\.(appcache|manifest))
expiration: "0m"
application_readable: true
http_headers:
Access-Control-Allow-Origin: "*"
- url: /(.*\.atom)
mime_type: application/atom+xml
static_files: static/html/\1
upload: static/html/(.*\.atom)
expiration: "1h"
http_headers:
Access-Control-Allow-Origin: "*"
- url: /(.*\.htc)
mime_type: text/x-component
static_files: static/html/\1
upload: static/html/(.*\.htc)
http_headers:
Access-Control-Allow-Origin: "*"
- url: /(.*\.html)
mime_type: text/html
static_files: static/html/\1
upload: static/html/(.*\.html)
expiration: "7d"
application_readable: true
http_headers:
Access-Control-Allow-Origin: "*"
- url: /(.*\.tpl)
mime_type: text/html
static_files: static/html/\1
upload: static/html/(.*\.tpl)
expiration: "7d"
application_readable: true
http_headers:
Access-Control-Allow-Origin: "*"
- url: /(.*\.rss)
mime_type: application/rss+xml
static_files: static/html/\1
upload: static/html/(.*\.rss)
expiration: "1h"
http_headers:
Access-Control-Allow-Origin: "*"
- url: /(.*\.txt)
mime_type: text/plain
static_files: static/html/\1
upload: static/html/(.*\.txt)
http_headers:
Access-Control-Allow-Origin: "*"
- url: /(.*\.xml)
mime_type: application/xml
static_files: static/html/\1
upload: static/html/(.*\.xml)
expiration: "1h"
application_readable: true
http_headers:
Access-Control-Allow-Origin: "*"
さまざまなコンテンツ タイプをさまざまなモジュールに分割しました。これには、dispatch.yaml が必要です。
ディスパッチ.yaml:
application: viewneo-eu
dispatch:
- url: "fonts.viewneo-eu.appspot.com/*"
module: fonts
- url: "img.viewneo-eu.appspot.com/*"
module: img
- url: "css.viewneo-eu.appspot.com/*"
module: css
- url: "js.viewneo-eu.appspot.com/*"
module: js
- url: "html.viewneo-eu.appspot.com/*"
module: html
- url: "cdn.viewneo-eu.appspot.com/*"
module: cdn
- url: "video.viewneo-eu.appspot.com/*"
module: cdn
- url: "audio.viewneo-eu.appspot.com/*"
module: cdn
- url: "dev.viewneo-eu.appspot.com/*"
module: dev
- url: "beta.viewneo-eu.appspot.com/*"
module: beta
app.yaml で常にセキュアを使用しているため、ワイルドカード サブサブ ドメインでは ssl が機能しないため、いつでもこれらにアクセスできます。
https://fonts-dot-viewneo-eu.appspot.com、
https://img-dot-viewneo-eu.appsport.com、...
等々。
それが役立つことを願っています。
よろしく
ロン