Fix contact form POST routing and bake env into build
- nginx: route POST /contact/ to contact.php, GET to router.php - Dockerfile: COPY .env into image - entrypoint.sh: source .env on container start - .dockerignore: allow .env to be included in build context
This commit is contained in:
+8
-2
@@ -81,8 +81,14 @@ http {
|
||||
limit_req zone=contact_limit burst=3 nodelay;
|
||||
limit_req_status 429;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME /var/www/html/src/api/router.php;
|
||||
fastcgi_param QUERY_STRING type=page&slug=contact;
|
||||
set $contact_script /var/www/html/src/api/router.php;
|
||||
set $contact_query "type=page&slug=contact";
|
||||
if ($request_method = POST) {
|
||||
set $contact_script /var/www/html/src/api/contact.php;
|
||||
set $contact_query "";
|
||||
}
|
||||
fastcgi_param SCRIPT_FILENAME $contact_script;
|
||||
fastcgi_param QUERY_STRING $contact_query;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user