Project

General

Profile

Actions

Support #7384

closed

[WServer::addResource] "/" vs "/foo"

Added by Aaron Wright over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
12/30/2019
Due date:
% Done:

0%

Estimated time:

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.

Actions #1

Updated by Roel Standaert over 4 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.

Actions #2

Updated by Roel Standaert over 4 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.

Actions #3

Updated by Aaron Wright over 4 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.

Actions #4

Updated by Roel Standaert about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF