fix: IIS sub-application deployment for production
Fixes 3 critical issues preventing production deployment on Windows IIS: 1. **IIS Sub-Application Path Stripping** - Changed URL patterns from ^roa2web/api/(.*) to ^api/(.*) - IIS sub-app at /roa2web automatically strips prefix - Requests arrive as /api/* not /roa2web/api/* 2. **SPA Fallback Absolute Path** - Changed from url="/index.html" to url="index.html" - Absolute paths (/) refer to site root, not sub-app - Relative path correctly serves from sub-app 3. **MIME Type Duplicates (500 Error)** - Added <remove> before <mimeMap> for .js, .json, .webmanifest - Prevents "duplicate collection entry" errors - Allows override of server-level MIME types Build Script Improvements: - Build-ROA2WEB.ps1: Copy public/ folder to temp build dir - Build-ROA2WEB.ps1: Added verification logging for web.config - ROA2WEB-Console.ps1: Fixed web.config verification location Cleanup: - Removed outdated web.config.10.0.20.36-INTERNAL - Removed temporary test files and docs Tested: https://roa2web.romfast.ro/roa2web/ - login page loads successfully 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
====================================================================
|
||||
ROA2WEB - Internal Application Server Configuration
|
||||
====================================================================
|
||||
Server: 10.0.20.36 (internal application server)
|
||||
Role: Application host + API proxy to localhost backend
|
||||
|
||||
This web.config ONLY goes on the INTERNAL server (10.0.20.36).
|
||||
It serves the frontend and proxies API calls to localhost:8000.
|
||||
|
||||
Location: C:\inetpub\wwwroot\roa2web\web.config (on 10.0.20.36)
|
||||
|
||||
⚠️ DO NOT use this config on 10.0.20.122 (public server)!
|
||||
====================================================================
|
||||
-->
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
<rewrite>
|
||||
<rules>
|
||||
<!-- Proxy API requests to unified backend on localhost -->
|
||||
<rule name="Proxy Unified API" stopProcessing="true">
|
||||
<match url="^roa2web/api/(.*)" />
|
||||
<action type="Rewrite" url="http://localhost:8000/api/{R:1}" />
|
||||
</rule>
|
||||
|
||||
<!-- Proxy uploads to unified backend on localhost -->
|
||||
<rule name="Proxy Uploads" stopProcessing="true">
|
||||
<match url="^roa2web/uploads/(.*)" />
|
||||
<action type="Rewrite" url="http://localhost:8000/uploads/{R:1}" />
|
||||
</rule>
|
||||
|
||||
<!-- SPA fallback - all other routes serve index.html -->
|
||||
<rule name="SPA Fallback" stopProcessing="true">
|
||||
<match url="^roa2web/.*" />
|
||||
<conditions logicalGrouping="MatchAll">
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
||||
</conditions>
|
||||
<action type="Rewrite" url="/roa2web/index.html" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
|
||||
<!-- Static content configuration -->
|
||||
<staticContent>
|
||||
<mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />
|
||||
<mimeMap fileExtension=".js" mimeType="application/javascript" />
|
||||
<mimeMap fileExtension=".json" mimeType="application/json" />
|
||||
</staticContent>
|
||||
|
||||
<!-- Client cache for static assets (1 year) -->
|
||||
<httpProtocol>
|
||||
<customHeaders>
|
||||
<add name="Cache-Control" value="public, max-age=31536000" />
|
||||
</customHeaders>
|
||||
</httpProtocol>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user