-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Website deployment: Fix builder redirect (#1696)
## Motivation for the change, related issues The `builder/` redirect does not work right now. Today, when any file (including PHP files), is subject to a `custom-redirects.php` redirect rule, we set that file aside in the `files-to-serve-via-php` folder. We set aside files that need special/custom treatment in a `files-to-serve-via-php` directory because nginx for the Playground website is configured to delegate requests for missing static files to WordPress/PHP. We leverage this fallback behavior in order to implement custom redirects and set custom headers for various static files. Unfortunately, this is causing problems with `builder/` redirects. When a directory is missing an index file, nginx responds with a 403 status rather than giving us a chance to redirect or handle the request. This is causing problems for the `/builder` redirect to `/builder/builder.html`. We use a stub `/builder/index.php` file and `custom-redirects.php` to support that redirect. During deployment `/builder/index.php` is moved to `/files-to-serve-via-php/builder/index.php`, so when the user requests `/builder`, nginx redirects to `/builder/`, tries to find an index file in that directory, and 403s when no index file is found. The good news is that PHP files never needed to be set aside to be subject to processing by `custom-redirects.php`. `custom-redirects.php` is invoked when running any PHP file. So we can leave `builder/index.php` in place and avoid this conflict with nginx. ## Implementation details This PR adjusts the deployment process to stop moving PHP files to `files-to-serve-via-php`. It also renames the directory to `static-files-to-serve-via-php` for clarity. ## Testing Instructions (or ideally a Blueprint) - Run `npm run build` locally - rsync the `website-deployment` and `dist/packages/playground/wasm-wordpress-net` folders to a staging server via SSH - Rename the remote `wasm-wordpress-net` directory to `updated-playground-files` - Run `website-deployment/apply-update.sh` to apply the updates - Make sure Playground loads on the staging site - Make sure a request for `builder/` redirects to `builder/builder.html`
- Loading branch information
1 parent
97519dc
commit 3715f21
Showing
4 changed files
with
39 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters