Ari
Ari

Reputation: 6169

AppEngine Nodejs not redirecting HTTP to HTTPS

I have set up my app.yaml file like so:

runtime: nodejs10
handlers:
  - url: /.*
    script: auto
    secure: always
    redirect_http_response_code: 301
  # Serve all static files with urls ending with a file extension
  - url: /(.*\..+)$
    static_files: dist/\1
    upload: dist/(.*\..+)$
    # catch all handler to index.html
  - url: /.*
    static_files: dist/index.html
    upload: dist/index.html

This has worked for Flask projects, but with my Nodejs project it doesn't seem to work. Do I need to change script: auto to something else?

Upvotes: 1

Views: 31

Answers (1)

Juancki
Juancki

Reputation: 1872

You need to add secure: always to each handler that this behavior is desired. Please notice that you have two handlers wit the same - url: /.*. The last definition of that url does not have the secure argument.

Upvotes: 1

Related Questions