Applicable to:
- Plesk Onyx 17.0
- Plesk Onyx 17.5
Question
-
How to install Java application in the domain home folder to make it available by direct link
http://example.com
instead ofhttp://example.com/java_app
? -
How to set up a redirect for
http://example.com
in order to redict it to Java applicationhttp://example.com/java_app
?
Answer
Such functionality is not implemented in Plesk.
As a workaround, create a rewrite rule:
It is possible to make JAVA application available by http://example.com
URL, using IIS rewrite rules:
-
Connect to the server via RDP.
-
Open the
%plesk_vhosts%\example.com\httpdocs\web.config
file.Note: change the "example.com" in the path above to the correct one.
-
Add the following directives:
CONFIG_TEXT:<rewrite>
<rules>
<rule name="java app rewrite rule" enabled="true">
<match url="^" />
<conditions>
</conditions>
<action type="Rewrite" url="http://example.com/java_app" /> </rule>
</rules>
</rewrite>Note: change the "java_app" to the correct Java application name.
-
Restart IIS to apply the changes:
C:\> iisreset
-
Go to Plesk > Domains > example.com > Apache & nginx Settings.
-
Insert the following rows to the Additional nginx directives field:
Note: change the "java_app" to the correct Java application name.
CONFIG_TEXT: location = / {
rewrite ^/(.*)$ /java_app last;
} -
Press the OK button to apply changes
Comments
0 comments
Please sign in to leave a comment.