Thanks to visit codestin.com
Credit goes to github.com

Skip to content

redirect-trailing-slash does nothing with active [[advanced.rewrites]] #387

@LoliPain

Description

@LoliPain

Search for duplicate issues

  • I already searched, and this issue is not a duplicate.

Issue scope

Docker / Kubernetes

Describe the bug

In my case I have to specify globing pattern to set alternative root path for my static. The config is:

[general]
....
redirect-trailing-slash = true
....
[[advanced.rewrites]] 
source = "/value/manage{**}" 
destination = "/$1"

That's required cause I store my static in ./public root, but endpoint is behind the nginx reverse proxy on location /value/manage

So, the accessed URL from browser is 'example.com/value/manage' provides no redirect to trailing slash URL, breaking my relative paths

I know the workaround is to specify rewrites inside reverse proxy configuration or probably just make hard redirect using [[advanced.redirects]] but anyways, the redirect-trailing-slash seems for me completely not working

How to reproduce it

  1. Create a new server with enabled {**} rewrite directive and specify redirect-trailing-slash = true
  2. Try to access server endpoint without trailing slash at the URL
    For example take example.com/manage

Expected behavior

HTTP 301 or HTTP 308 redirect to example.com/manage/ URL

Complementary information

No response

Build target

Docker linux/amd64

Environment and specs

  • static-web-server: [e.g. v1.24.1]
  • OS: [e.g. Debian 12.2, Macos 14.1.2, Windows 11, etc]
  • Arch: [e.g. x86_64 (64-bit), ARM (32-bit), ARM64 (64-bit), i686 (32-bit), etc]
  • Docker: [e.g. 20.10.7]
  • Client: [e.g. Chrome 91.0.4472.114, Firefox 119.0.1, curl, etc]
  • Specify others

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is neededv2v2 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions