Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Running under IIS? #75

Open
catamaican opened this issue Dec 5, 2018 · 3 comments
Open

Running under IIS? #75

catamaican opened this issue Dec 5, 2018 · 3 comments

Comments

@catamaican
Copy link

catamaican commented Dec 5, 2018

I've tried to run the app using IIS rewrites rules (and Node, of course).

My "achievement" is to get it running using an URL like this: "SERVER/api2/gamification/user/user345" and a rule like this:

<rewrite> <rules> <rule name="ReverseProxyInboundRule1" stopProcessing="true"> <match url="gamification/(.*)" /> <action type="Rewrite" url="http://localhost:3030/{R:1}" logRewrittenUrl="true" /> </rule> </rules> </rewrite>

However, when I try to get the XP (which works under Node with http://localhost:3030/xp) or the Events, all I get is IIS 404 (The resource cannot be found, Requested URL: /api2/gamification/xp).

Have you tried this? Could you help me, please?

Thank you,
Catalin

@janrenz
Copy link
Contributor

janrenz commented Dec 5, 2018

Hi Catalin,
Do you get any logs in the service?
Jan

@catamaican
Copy link
Author

catamaican commented Dec 6, 2018

Hi,

in IIS I get something like this


2018-12-06 07:48:09 IP_FOR_MY_SERVER GET /api2/gamification/user/user123 - 80 - IP_FOR_MY_SERVER Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64;+rv:63.0)+Gecko/20100101+Firefox/63.0 - 304 0 0 862

**2018-12-06 07:48:13 IP_FOR_MY_SERVER GET /api2/gamification/xp - 80 - IP_FOR_MY_SERVER Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64;+rv:63.0)+Gecko/20100101+Firefox/63.0 - _404 0_ 0 16**

2018-12-06 07:48:13 IP_FOR_MY_SERVER GET /favicon.ico - 80 - IP_FOR_MY_SERVER Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64;+rv:63.0)+Gecko/20100101+Firefox/63.0 - 200 0 0 21
(here the favicon is served from IIS application root and not from Node)

2018-12-06 07:48:28 IP_FOR_MY_SERVER GET /api2/gamification/xp - 80 - IP_FOR_MY_SERVER Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64;+rv:63.0)+Gecko/20100101+Firefox/63.0 - 404 0 0 2

2018-12-06 07:48:28 IP_FOR_MY_SERVER GET /favicon.ico - 80 - IP_FOR_MY_SERVER Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64;+rv:63.0)+Gecko/20100101+Firefox/63.0 - 304 0 0 0

For the first, successful, one, I also have hits in Node console, but for the unsuccessful one, Node does not receive the request...
NODE:
info: request date=2018-12-06T07:49:14.730Z, env=development, id=m, pid=5836, hostName=win-0-54, foo=bar, method=GET, host=localhost:3030, path=/user/user123, query=, ip=IP_FOR_MY_SERVER:50366, statusCode=304

@catamaican
Copy link
Author

Also, I've done several "experiments" like the following:

GET /api2/gamification/xp/xpz --> is translated in GET http://localhost:3030/xp/xp --> but I get errors in Node and I do not know where should I modify to get rid of them (for all the services - Events/Achievements/XP)

warn: request date=2018-12-06T08:10:25.806Z, env=development, id=m, pid=5836, hostName=win-0-54, foo=bar, method=GET, host=localhost:3030, path=/xp/xpz, query=,
 ip=IP_FOR_MY_SERVER:50370, statusCode=400
error:  BadRequest: Cast to ObjectId failed for value "z" at path "_id" for model "xp" at new BadRequest (D:\gamification\node_modules\@feathersjs\errors\lib\index.js:86:17)
    at errorHandler (D:\gamification\node_modules\feathers-mongoose\lib\error-handler.js:33:31)
    at process._tickCallback (internal/process/next_tick.js:68:7)
warn: request date=2018-12-06T08:10:35.224Z, env=development, id=m, pid=5836, hostName=win-0-54, foo=bar, method=GET, host=localhost:3030, path=/xp/z, query=, ip=IP_FOR_MY_SERVER:50370, statusCode=400

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants