title: How do you host a multi-page Dash application on IIS?
body: <p>I am trying to host a multi-page Dash application on IIS for internal use at work. I have been able to get single-page Dash applications, such as below to work.</p>
  <pre><code>from flask import Flask
  import dash
  import dash_html_components as html
  from dash.dependencies import Input, Output
  
  server=Flask(__name__)
  app = dash.Dash(__name__, suppress_callback_exceptions=True, show_undo_redo=True, server=server)
  app.layout = html.Div([])
  @app.callback(Output('page-content', 'children'),
                Input('url', 'pathname'))
  def hello():
      return &quot;Single page dash app works but not multi-page&quot;
  if __name__ == &quot;__main__&quot;:
      app.run_server(host='0.0.0.0', port=84)
  </code></pre>
  <p>However, when I try to use it on multi-page dash applications, as described in the user manual <a href="https://dash.plotly.com/urls" rel="nofollow noreferrer">here</a>, it doesn't work correctly. I am able to host the application using Waitress, but would prefer something more stable and secure. IIS is how my company hosts other internal applications, so I was asked to host it that way. When attempting to use what I believe is the correct settings and handler mappings, I receive an error message on the page that simply says:</p>
  <p>Internal Server Error</p>
  <p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
  <p>I believe that the issue is due to the fact that the flask application behind my Dash application is created in one script, and the entry point to the overall application is in another. I am not sure how to reconcile this, as the example page in the Dash documentation says that it must be this way.</p>
  <p>So, how can I make this work?</p>
  <p>cheers</p>