title: flutter web built release but nginx route 404
body: <p>Similar case:
  <a href="https://stackoverflow.com/questions/63545088/flutter-web-app-blank-screen-in-release-mode">flutter-web-app-blank-screen-in-release-mode</a></p>
  <p>I have an AWS EC2 cloud server. and I built a flutter web build in my EC2 Server.
  and cross-connect the flutter web index.html to Nginx.</p>
  <pre><code>&gt; $ flutter build web
  
   Building with sound null safety 
  
  Compiling lib/main.dart for the Web...                           1,491ms
  </code></pre>
  <p>so EC2 can 200 OK.
  <a href="https://i.stack.imgur.com/kegWV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kegWV.png" alt="enter image description here" /></a></p>
  <p>and routed navigate another page and refreshed.
  <a href="https://i.stack.imgur.com/3YUbM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3YUbM.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/5BkMj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5BkMj.png" alt="enter image description here" /></a></p>
  <p>my EC2 Server nginx config is:</p>
  <pre><code>server {
          listen 80 default_server;
          listen [::]:80 default_server;
  
          root /var/www/flutter_web_project/build/web; # &lt;- the flutter build web released result folder
  
          index index.html index.htm index.nginx-debian.html;
  
          server_name _;
  
          location / {
                  try_files $uri $uri/ =404;
          }
  }
  </code></pre>
  <p>and i used url_strategy dependency</p>
  <pre><code>dependencies:
    flutter:
      sdk: flutter
  
      url_strategy: ^0.2.0
  </code></pre>
  <p>and main.dart source:</p>
  <pre><code>...
  import 'package:url_strategy/url_strategy.dart';
  
  void main() {
    setPathUrlStrategy();
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'flutter web sample',
        theme: ThemeData(
          visualDensity: VisualDensity.adaptivePlatformDensity,
        ),
        home: locationPlatform(),
        onGenerateRoute: WebRouter.generate,
        initialRoute: '/',
      );
    }
  ...
  </code></pre>