Skip to content

Instantly share code, notes, and snippets.

@sonnysasaka
sonnysasaka / nginx-app.conf
Last active September 10, 2024 09:47
Allow serving static files on Google App Engine second generation PHP flex runtime
# This file is used by App Engine flex environment PHP runtime by name convention nginx-app.conf:
# https://cloud.google.com/appengine/docs/flexible/php/runtime#customize_nginx
# App Engine rewrites everything to index.php$uri, this prevents us to catch
# anything else with `location` block, so the hack is to catch it with another
# rewrite that lets us handle in our own `location ~ ^/myapp` below
# (https://github.com/GoogleCloudPlatform/buildpacks/blob/ff2ea2737a928087dcec192bf3ce103dc356ad5e/pkg/nginx/nginx.go#L93)
rewrite ^/index.php(.*)$ /myapp$1;
# Handle this our way first because we want to try serving a file if it matches,
@sonnysasaka
sonnysasaka / nginx-app.conf
Created February 27, 2024 18:28
Allow serving static files on Google App Engine second generation PHP flex runtime - alternate
# This file is used by App Engine flex environment PHP runtime by name convention nginx-app.conf:
# https://cloud.google.com/appengine/docs/flexible/php/runtime#customize_nginx
# App Engine rewrites everything to index.php$uri, this prevents us to catch
# anything else with `location` block, so the hack is to catch it with another
# rewrite that lets us handle in our own `location ~ ^/myapp` below
# (https://github.com/GoogleCloudPlatform/buildpacks/blob/ff2ea2737a928087dcec192bf3ce103dc356ad5e/pkg/nginx/nginx.go#L93)
rewrite ^/index.php(.*)$ /myapp$1;
# If you need to handle any php file, not just index.php

User:

in this directory, create a simple program to practice using mouse. It's just a single html page, that displays the mouse pointer visibly and if left click is pressed it does something maybe like shines red color, but right click is blue color, and both is purple. This is for kids, so disable all other functionality so it's not frustrating. Just plain background like white.

Assistant:

I'll create a simple interactive mouse practice program for kids. Let me plan this out first.

Assistant: