<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Vorformatiert Zchn";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLVorformatiertZchn
{mso-style-name:"HTML Vorformatiert Zchn";
mso-style-priority:99;
mso-style-link:"HTML Vorformatiert";
font-family:"Courier New";
mso-fareast-language:#2000;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=en-DE link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Dear, <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I just have a server where multiple web applications are running. The web applications are running on several ports and are distinguished by a virtual path. For example, the web application for our scenario is running using the virtual path “/webui”. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Each virtual path passed the request to a kestrel webserver using proxy_pass to localhost. I just used the sub_filter directive to modify the response DOM (to change the url e.g. from “/” to “/webui”). Same I do with the redirects. Everything work fine, except of AJAX request. Inside of some javascript files, I use jquery to make an AJAX Call to my webservice and puts the HTTP response somewhere. Of course these jquery calls knows about fix urls, which needs to be arranged. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>While the AJAX request does not know anything about the NGINX Proxy, they does not know anything about the “webui” path. So I need to find a solution to manipulate these javascript code:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>$.ajax(</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>{</span><span style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>url: </span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>/Devices/Test</span><span style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>, data: $(</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>“#test”</span><span style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>).serialize(),method: "POST",</span><span style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'> <span lang=EN-US>…})<o:p></o:p></span></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'><o:p> </o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>And have to be translated to <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'><o:p> </o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>$.ajax(</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>{</span><span style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>url: </span><b><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>/webui/</span></b><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>Devices/Test</span><span style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>, data: $(</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>“#test”</span><span style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'>).serialize(),method: "POST",</span><span style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'> <span lang=EN-US>…})<o:p></o:p></span></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'><o:p> </o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:#2000'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Does anyone knows how to achive that?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Kind regards, <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Sebastian.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p></div></body></html>