I've got some problem where google app engine flexible custom runtime with 
web font(ttf, woff, woff2).
I'vs got 404 error for web font resource.

app.yaml
runtime: custom
env: flex


Docker file
# The standard nginx container just runs nginx. The configuration file added
# below will be used by nginx.
FROM nginx

# Copy the nginx configuration file. This sets up the behavior of nginx, 
most
# importantly, it ensure nginx listens on port 8080. Google App Engine 
expects
# the runtime to respond to HTTP requests at port 8080.
COPY nginx.conf /etc/nginx/nginx.conf
COPY extra-mime.types /etc/nginx/extra-mime.types

# create log dir configured in nginx.conf
RUN mkdir -p /var/log/app_engine

# Create a simple file to handle heath checks. Health checking can be 
disabled
# in app.yaml, but is highly recommended. Google App Engine will send an 
HTTP
# request to /_ah/health and any 2xx or 404 response is considered healthy.
# Because 404 responses are considered healthy, this could actually be left
# out as nginx will return 404 if the file isn't found. However, it is 
better
# to be explicit.
RUN mkdir -p /usr/share/nginx/www/_ah && \
    echo "healthy" > /usr/share/nginx/www/_ah/health

# Finally, all static assets.
ADD www/ /usr/share/nginx/www/
RUN chmod -R a+r /usr/share/nginx/www

nginx.conf
events {
    worker_connections 1024;
}

http {
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    include /etc/nginx/mime.types;
    include /etc/nginx/extra-mime.types;
    default_type application/octet-stream;

    # Logs will appear on the Google Developer's Console when logged to this
    # directory.
    access_log /var/log/app_engine/app.log;
    error_log /var/log/app_engine/app.log;

    gzip on;
    gzip_disable "msie6";
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_min_length 256;
    gzip_types text/plain text/css application/json 
application/x-javascript application/javascript text/xml application/xml 
application/xml+rss text/javascript;

    server {
        # Google App Engine expects the runtime to serve HTTP traffic from
        # port 8080.
        listen 8080;
        root /usr/share/nginx/www;
        index index.html index.htm;


extra-mime.types
types {
   font/truetype                             ttf;
   application/x-font-woff2                  woff2;
   font/opentype                             otf;
}

When I run docker on my local computer, there is no problem and all mime 
type has no problem and font rendering is working.

But, when I deploy to app engine(flexible environment custom runtime), I've 
got 404 error.(content-type is text/html for woff/woff2)

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/a8841f68-85ca-40ff-ae73-a00fab5ac7fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [google-appengine]... 임형주

Reply via email to