An Azure service that is used to provision Windows and Linux virtual machines.
Hello Intellient Team
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
- Is your Python NSSM service running and accessible directly at [http://172.xxx.xxx.xx:7777] from the IIS server machine itself (e.g., using a browser or curl on the IIS server)?
- Can you confirm if "Enable Proxy" is checked in IIS Application Request Routing server proxy settings, and do you have the exact inbound and outbound URL rewrite rules configuration you applied for the genai.com site?
Check URL Rewrite Rules
Depending on the route of your app, your inbound rule should match all incoming requests to genai.com and rewrite them to http://172.xxx.xxx.xx:7777/{R:1} and Outbound rules should rewrite response URLs (e.g., from http://172.xxx.xxx.xx:7777 back to http://genai.com) if any absolute URLs are returned. The rewrite URL should be consistent with your current backend port (7777).
After deleting your old site and creating a new one for port 7777, cached DNS or proxy responses can cause "refused to connect" errors.
Clear your browser cache and IIS server cache/recycle the IIS site or app pool and Confirm Backend Service Availability on Port 7777 and even though direct testing on http://172.xxx.xxx.xx:7777 works on the server, ensure no firewall or network restriction prevents IIS from connecting to port internally.
ARR or IIS logs may show proxy connection errors or timeouts. Look for errors in IIS logs or Windows Event Viewer for Application or System events.
Please adjust proxy timeouts (higher value such as 180 seconds or more) if your app takes longer. Also, in ARR proxy settings, try toggling "Reverse rewrite host in response headers" checkbox.
Additonally, Test-NetConnection -ComputerName 172.xxx.xxx.xx -Port 7777 in PowerShell
If successful, the port is reachable from the IIS server.
Even if [http://172.xxx.xxx.xx:7777] works from IIS server, test from the client machine where genai.com is accessed.
Also check firewall settings on the machine hosting the Python app: and ensure inbound rule allows TCP port 7777.
Additionally please refer Microsoft documentation for details:
- Reverse Proxy with URL Rewrite v2 and Application Request Routing : https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing
- Troubleshooting 502 errors in ARR :https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/iis/application-request-routing/troubleshooting-502-errors-in-arr
- Creating Rewrite Rules for the URL Rewrite Module : https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module
- ARR Server Proxy Settings overview and explanation: https://stackoverflow.com/questions/4243959/iis-reverse-proxy-with-rewrites-cant-handle-a-redirect-from-the-server-we-proxy
Regards
Himanshu