amplify-education / serverless-domain-manager

Serverless plugin for managing custom domains with API Gateways.
MIT License
941 stars 232 forks source link

Add www redirection to non-www url #626

Open OleksandrKryvobok opened 8 months ago

OleksandrKryvobok commented 8 months ago

Support Question

Question Can you help, please? How I can create a redirect from www.example.com to example.com? Because if I add a CNAME record in r53 that give me an error like this:

This site can’t provide a secure connection www.example.com uses an unsupported protocol.
ERR_SSL_VERSION_OR_CIPHER_MISMATCH

Domain Manager Configuration


plugins:
  - serverless-dotenv-plugin
  - serverless-prune-plugin
  - serverless-domain-manager
#  - serverless-plugin-warmup

custom:
  prune:
    automatic: true
    number: 2
  domains:
    prod: example.com
    dev: dev.example.com
  customDomain:
    domainName: ${self:custom.domains.${opt:stage, 'dev'}}
    basePath: ""
    stage: ${opt:stage, 'dev'}
    certificateName: 'example.com'
    createRoute53Record: true
    endpointType: 'edge'
    securityPolicy: tls_1_2