Support #7384
closed[WServer::addResource] "/" vs "/foo"
0%
Description
I'm running a wthttp server behind a reverse proxy (nginx) that I want to add a resource to. When I add the resource to "/foo", my resource is called for "/foo" and "/foo/bar", but when I add the resource to "/", only "/" works. "/foo" does not.
This seems like different behavior for the two cases, and I was wondering if there was a work around. I would like my resource to be at "/", as the reverse proxy will handle the initial pathing and forward the request straight to my wthttp server. If possible I would like to not have to add my resource at "/foo" as that'll change my request.path() and request.PathInfo() results.
Updated by Roel Standaert about 5 years ago
This is because by default it will think that e.g. /foo
is a file in your docroot. Changing the --docroot
to .;
(remember to escape the semicolon or use quotes in your command line) should work, except that we're currently handling the empty part after ; incorrectly (this will be fixed in the next release). The best you can do right now is set it to some path that you likely won't encounter, e.g. .;/some-path
.
Updated by Roel Standaert about 5 years ago
- Status changed from New to Resolved
I pushed a fix that should make .;
work properly. I will set this to resolved and will close it on release 4.2.1.
Updated by Aaron Wright about 5 years ago
Thank you for the explanation. I was able to modify docroot to get my expected behavior. I'll have to see about incorporating our fix in our build.
Updated by Roel Standaert about 5 years ago
- Status changed from Resolved to Closed