У меня много проблем с поиском, как сопоставить несколько доменов с несколькими сервисами в GAE. Вот конфигурация:
- Одно приложение представляет собой Go API, развернутое в GAE в стандартной среде
- Второе приложение представляет собой приложение Angular, также развернутое в GAE в стандартной среде, но в качестве другой службы.
Вот файлы app.yaml:
Перейти приложение app.yaml
runtime: go
api_version: go1.9
handlers:
- url: /.*
script: _go_app
Угловое приложение app.yaml
service: stage
runtime: python27
api_version: 1
threadsafe: true
skip_files:
- ^(?!dist) # Skip any files not in the dist folder
handlers:
# Routing for bundles to serve directly
- url: /((?:inline|main|polyfills|styles|vendor)\.[a-z0-9]+\.bundle\.js)
secure: always
redirect_http_response_code: 301
static_files: dist/\1
upload: dist/.*
# Routing for a prod styles.bundle.css to serve directly
- url: /(styles\.[a-z0-9]+\.bundle\.css)
secure: always
redirect_http_response_code: 301
static_files: dist/\1
upload: dist/.*
# Routing for typedoc, assets and favicon.ico to serve directly
- url: /((?:assets|docs)/.*|favicon\.ico)
secure: always
redirect_http_response_code: 301
static_files: dist/\1
upload: dist/.*
# Any other requests are routed to index.html for angular to handle so we don't need hash URLs
- url: /.*
secure: always
redirect_http_response_code: 301
static_files: dist/index.html
upload: dist/index\.html
http_headers:
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Frame-Options: DENY
У меня есть домен, и я хочу связать Go API с api.domain.com и приложение Angular с domain.com .
Перейдя на App Engine> Настройки> Пользовательские домены Мне удалось добавить домен для моего API, и он отлично работает.
Но сейчас я не могу найти способ сопоставить domain.com с моим приложением Angular. Переход к одним и тем же настройкам не дает мне возможности сопоставить другой сервис с моим доменом.
Спасибо за помощь и хорошего дня!