Has a dot as the first character in a static file directory, which is not allowed in Google App Engine
I currently have the following config file in Google App Engine
application: jstock-affiliate
version: 1
runtime: python27
api_version: 1
threadsafe: true
auto_id_policy: default
handlers:
- url: /.well-known
static_dir: .well-known
- url: /static
static_dir: static
- url: /.*
script: main.application
libraries:
- name: webapp2
version: latest
When I access the following urls in my local, both work fine
http://localhost:9080/.well-known/a.txt - OK
http://localhost:9080/static/a.txt - OK
However, after deploying to Google App Engine, it doesn't fit the folder .well-known
http://jstock-affiliate.appspot.com/.well-known/a.txt - ERROR
http://jstock-affiliate.appspot.com/static/a.txt - OK
I need a dot as the first character in a folder name because of https://medium.com/google-cloud/let-s-encrypt-with-app-engine-8047b0642895
May I know how I can solve these problems?
source to share
The new Flex App Engine does not provide a "handler" configuration in app.yaml
. The only way to make this work is to add a directive location
to the file nginx-app.conf
by placing the directory well-known
in the directory document_root
specified in app.yaml
(mainly in the root of the application)
location ^~ /.well-known/ {
alias /app/well-known/;
}
I am using matching ^~
to prevent the regex rule not to match directories starting with a period.
source to share