Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure App Service preset #2231

Closed
danielroe opened this issue Mar 8, 2024 · 2 comments
Closed

Azure App Service preset #2231

danielroe opened this issue Mar 8, 2024 · 2 comments
Labels

Comments

@danielroe
Copy link
Member

It would be nice to have a built-in azure app service provider (see nuxt/nuxt#26140).

I haven't validated yet whether this is possible, so this is just a tracker.

@danielroe danielroe changed the title Azure App Service provider Azure App Service preset Mar 8, 2024
@dombarnes
Copy link

with ssr: false and nitro: { preset: 'static' } I have a custom web.config to be able to run on Azure App Service (Integrated Pipeline)

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!-- To customize the asp.net core module uncomment and edit the following section.
    For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
    <system.webServer>
      <webSocket enabled="false" />
      <httpProtocol>
        <customHeaders>
          <clear />
          <remove name="x-powered-by" />
          <remove name="server" />
          <remove name="Cache-Control" />
          <add name="Cache-Control" value="public, max-age=31536000" />
          <add name="Pragma" value="no-cache" />
        </customHeaders>
      </httpProtocol>
      <staticContent>
        <mimeMap fileExtension=".js" mimeType="application/javascript" />
        <mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />
        <mimeMap fileExtension=".json" mimeType="application/json" />
        <mimeMap fileExtension=".otf" mimeType="font/otf" />
        <mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />
        <mimeMap fileExtension=".js.gz" mimeType="application/javascript" />
        <mimeMap fileExtension=".dat.gz" mimeType="application/octet-stream" />
        <mimeMap fileExtension=".dll.gz" mimeType="application/octet-stream" />
        <mimeMap fileExtension=".json.gz" mimeType="application/json" />
        <mimeMap fileExtension=".wasm.gz" mimeType="application/wasm" />
        <mimeMap fileExtension=".blat.gz" mimeType="application/octet-stream" />
        <mimeMap fileExtension=".html.gz" mimeType="text/html" />
        <mimeMap fileExtension=".css.gz" mimeType="text/css" />
        <mimeMap fileExtension=".ico.gz" mimeType="image/x-icon" />
        <mimeMap fileExtension=".svg.gz" mimeType="image/svg+xml" />
        <mimeMap fileExtension=".js.br" mimeType="application/javascript" />
        <mimeMap fileExtension=".dat.br" mimeType="application/octet-stream" />
        <mimeMap fileExtension=".dll.br" mimeType="application/octet-stream" />
        <mimeMap fileExtension=".json.br" mimeType="application/json" />
        <mimeMap fileExtension=".wasm.br" mimeType="application/wasm" />
        <mimeMap fileExtension=".blat.br" mimeType="application/octet-stream" />
        <mimeMap fileExtension=".html.br" mimeType="text/html" />
        <mimeMap fileExtension=".css.br" mimeType="text/css" />
        <mimeMap fileExtension=".ico.br" mimeType="image/x-icon" />
        <mimeMap fileExtension=".svg.br" mimeType="image/svg+xml" />
      </staticContent>
      <modules runAllManagedModulesForAllRequests="true"/>
      <rewrite>
        <rules>
          <!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
          <rule name="StaticContent">
            <action type="Rewrite" url="{PATH_INFO}" />
          </rule>
          <rule name="Handle History Mode and custom 404/500" stopProcessing="true">
            <match url="(.*)" />
            <conditions logicalGrouping="MatchAll">
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
              <!-- Because each path is generated in a folder, this breaks the site -->
              <!-- <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> -->
            </conditions>
            <action type="Rewrite" url="index.html" />
          </rule>
          <!-- All other URLs are mapped to the Node.js site entrypoint -->
          <rule name="DynamicContent">
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True" />
            </conditions>
            <action type="Rewrite" url="index.html" />
          </rule>
        </rules>
      </rewrite>
      <!-- Make sure error responses are left untouched -->
      <httpErrors existingResponse="PassThrough" />
    </system.webServer>
  </configuration>

If I toggle ssr: true, it doesn't seem to work, just rewrites all paths back to /.
I am by no means any expert on IIS!

@pi0
Copy link
Member

pi0 commented Jan 7, 2025

Moving to the unified tracker: #2973

  • Please upvote 👍🏼 this (closed) issue to support
  • Please comment here if you would like to work on it

@pi0 pi0 closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants