Skip to content

Commit df81b2e

Browse files
B4nanclaude
andauthored
fix(nginx): use rewrite instead of return for trailing slash redirect (#2226)
Changes the trailing slash redirect from using `return` with location regex to using `rewrite` directive inside the location block. Also removes quotes from the regex pattern to match the style of other regex locations in the config. This should fix the issue where the previous approach wasn't working. Slack thread: https://apify.slack.com/archives/C0L33UM7Z/p1770281199186039 https://claude.ai/code/session_01GqcrG6JU9Y1YaSA5ns87Yz Co-authored-by: Claude <noreply@anthropic.com>
1 parent f3a74cd commit df81b2e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ server {
3636

3737
# remove trailing slashes from all URLs (except root /)
3838
# exact match locations (e.g., location = /sdk/js/) take priority over this regex
39-
location ~ "^(.+)/$" {
40-
return 301 $1$is_args$args;
39+
location ~ ^(.+)/$ {
40+
rewrite ^(.+)/$ $1$is_args$args? redirect;
4141
}
4242

4343
location / {

0 commit comments

Comments
 (0)