{"action":"created","issue":{"url":"https://api.github.com/repos/tjanczuk/iisnode/issues/271","labels_url":"https://api.github.com/repos/tjanczuk/iisnode/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/tjanczuk/iisnode/issues/271/comments","events_url":"https://api.github.com/repos/tjanczuk/iisnode/issues/271/events","html_url":"https://github.com/tjanczuk/iisnode/issues/271","id":13327274,"number":271,"title":"URL passed to node does not reflect prior IIS URL Rewrites","user":{"login":"dpolivy","id":3200655,"avatar_url":"https://avatars.githubusercontent.com/u/3200655?v=3","gravatar_id":"","url":"https://api.github.com/users/dpolivy","html_url":"https://github.com/dpolivy","followers_url":"https://api.github.com/users/dpolivy/followers","following_url":"https://api.github.com/users/dpolivy/following{/other_user}","gists_url":"https://api.github.com/users/dpolivy/gists{/gist_id}","starred_url":"https://api.github.com/users/dpolivy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpolivy/subscriptions","organizations_url":"https://api.github.com/users/dpolivy/orgs","repos_url":"https://api.github.com/users/dpolivy/repos","events_url":"https://api.github.com/users/dpolivy/events{/privacy}","received_events_url":"https://api.github.com/users/dpolivy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2013-04-18T01:01:50Z","updated_at":"2015-04-09T17:45:50Z","closed_at":null,"body":"I have some IIS Rewrite rules that transform a URL prior to it being rewritten to my node.js app. For caching purposes, we include a cache-busting hash value (or timestamp) in our URLs, and then use IIS to remove it when serving up the file. This allows us to have far-future cache expiration on our URLs, but still rev the files without changing the filenames.\r\n\r\nHere's an example:\r\n\r\n1. ORIGINAL URL: \"/path/<hash>/file.jpg\"\r\n2. IIS Rewrite rule takes ORIGINAL URL and produces output of \"/path/file.jpg\"\r\n3. A second IIS Rewrite rule takes an INPUT URL of \"/path/file.jpg\", and rewrites that URL to point to my server.js node app.\r\n\r\nNow, in my node app, the request URL comes in as ORIGINAL URL, aka \"/path/<hash>/file.jpg\". What I want (expect) is that the URL would be the *input URL* to step #3 above (the rule that passes a URL to node, aka \"/path/file.jpg\").\r\n\r\nIs it possible for iisnode to know and forward the INPUT URL instead of the ORIGINAL URL?\r\n\r\nI can obviously work around this in node by specifying my routes for both URLs, but it would be a lot cleaner to simply leave this to IIS and have the rewritten URL passed in to node.\r\n\r\nI do have some Failed Request Tracing logs if it helps explain the scenario.\r\n"},"comment":{"url":"https://api.github.com/repos/tjanczuk/iisnode/issues/comments/91306903","html_url":"https://github.com/tjanczuk/iisnode/issues/271#issuecomment-91306903","issue_url":"https://api.github.com/repos/tjanczuk/iisnode/issues/271","id":91306903,"user":{"login":"ashelley","id":3195045,"avatar_url":"https://avatars.githubusercontent.com/u/3195045?v=3","gravatar_id":"","url":"https://api.github.com/users/ashelley","html_url":"https://github.com/ashelley","followers_url":"https://api.github.com/users/ashelley/followers","following_url":"https://api.github.com/users/ashelley/following{/other_user}","gists_url":"https://api.github.com/users/ashelley/gists{/gist_id}","starred_url":"https://api.github.com/users/ashelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashelley/subscriptions","organizations_url":"https://api.github.com/users/ashelley/orgs","repos_url":"https://api.github.com/users/ashelley/repos","events_url":"https://api.github.com/users/ashelley/events{/privacy}","received_events_url":"https://api.github.com/users/ashelley/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T17:45:50Z","updated_at":"2015-04-09T17:45:50Z","body":"My solution was to use a main application router at the top level but it seems to me that it would be nice to be able to rewrite urls before they hit node although obviously this works just as good for this usecase:\r\n\r\nhttps://github.com/ashelley/hellohtml/blob/e35a534a96a5436e8a71ee41cf2d48a7ad05befa/siteextension/web.config#L10-12\r\n\r\nhttps://github.com/ashelley/hellohtml/blob/e35a534a96a5436e8a71ee41cf2d48a7ad05befa/app.js\r\n"}}