Skip to content

Commit

Permalink
Allow short usernames in FEM staging projects
Browse files Browse the repository at this point in the history
Match 2 or 3 characters as language codes in FEM staging URLs. Add a specific `location` block for the test locale.
  • Loading branch information
eatyourgreens committed Sep 11, 2023
1 parent becc44c commit 9b833a0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion nginx-fem-staging-redirects.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ location ~* ^/projects/[\w-]*?/[\w-]+?/?$ {
}

# FEM Projects app routes for project index page with locale (optional trailing slash)
location ~* "^/projects/[[:alpha:]]{2,4}(?:-[[:alnum:]]{0,4})?/[\w-]*?/[\w-]+?/?$" {
location ~* "^/projects/[[:alpha:]]{2,3}(?:-[[:alnum:]]{0,4})?/[\w-]*?/[\w-]+?/?$" {
resolver 1.1.1.1;
proxy_pass $fe_project_uri;
proxy_set_header Host $fe_project_host;

include /etc/nginx/proxy-security-headers.conf;
}

# FEM Projects app routes for project index page with the test locale (optional trailing slash)
location ~* "^/projects/test/[\w-]*?/[\w-]+?/?$" {
resolver 1.1.1.1;
proxy_pass $fe_project_uri;
proxy_set_header Host $fe_project_host;
Expand Down

0 comments on commit 9b833a0

Please sign in to comment.