-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: basic support in nginx for supporting redirects
We can generate a list of redirects in `config/nginx-redirects.conf` during build and nginx will use this to perform server-side redirects for us
- Loading branch information
1 parent
e2bc77a
commit 42a44f7
Showing
4 changed files
with
37 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ public | |
!.env.example | ||
graphql-types.ts | ||
cli | ||
dist | ||
dist | ||
config/nginx-redirects.conf |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodejs 16.18.1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This is an example of how the nginx redirects should look like. | ||
# | ||
# When building the site, part of the output should be this file, | ||
# populated with the data from the redirect metadata from the pages | ||
# | ||
# Nginx has a limit on how big the redirects-map.conf can be, which is controlled | ||
# via map_hash_bucket_size variable. If you get the following error: | ||
# | ||
# [emerg]: could not build the map_hash, | ||
# | ||
# you should increase the map_hash_bucket_size to account for the filesize. Say your | ||
# nginx-redirects.conf is 30Kb, you set the map_hash_bucket_size variable in the http | ||
# block of nginx.conf to 30720; | ||
|
||
# Redirect from /old_page to /new_page | ||
/old_page /new_page; |
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