Applicable to:
- Plesk for Windows
Symptoms
-
Subpath of the website, e.g.
example.com/api/test
shows "error 404" in a web-browser. -
A website also may show the following error:
CONFIG_TEXT: 405 - HTTP verb used to access this page is not allowed
-
Node.js application is deployed using Node.js extension.
-
\api\test
does not exist on a filesystem and should be generated dynamically via Node.js. -
Web application works as expected when iisnode is not used, and the required path
example.com:3000/api/test
is available.
Cause
Node.js extension creates an URL rewrite rule in IIS as follows:
CONFIG_TEXT: <rewrite>
<rules>
<rule name="startup-file">
<match url="^$" />
<action type="Rewrite" url="<?= htmlentities($this->startupFile) ?>" />
</rule>
</rules>
</rewrite>
The existing IIS rewrite rule is not compatible with the application.
This is a Bug in the Node.js extension #EXTNODEJS-46 which will be fixed in future product updates.
Resolution
-
Connect to the server via RDP.
-
Open IIS Manager > SERVER_NAME > example.com > URL Rewrite > startup-file.
-
Change Pattern from
^$
to/*
to route everything to Node.js Startup File.Note: the solution does not address all the use cases. For example, it may be required to create the additional rewrite rule to rewrite a single subfolder only, using the folder name as a pattern.
E.g. to rewriteexample.com/api/
, use the Patternapi*
:
Comments
0 comments
Please sign in to leave a comment.