title: Deploy asp.net core and react on an apache centOS
body: <p>I am trying to deploy my Asp.net core web with react on an Apache server but the resource and SPA files doesn't reload.
  I want to deploy myapp in <code>eg: domain.com/myapp</code></p>
  <ul>
  <li>myapp run <code>http://127.0.0.1:5050</code></li>
  <li>configuration in apache2 <code>/etc/apache2/conf.d/myapp.conf</code></li>
  </ul>
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerAdmin root@domain.com
      ServerName domain.com
      ServerAlias www.domain.com
      &lt;Location /myapp &gt;
          ProxyPreserveHost On
          ProxyPass http://127.0.0.1:5050/
          ProxyPassReverse http://127.0.0.1:5050/
      &lt;/Location&gt;
      RewriteEngine on
      RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
      RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
      RewriteRule /(.*) ws://127.0.0.1:5050/$1 [P]
      ErrorLog /var/log/apache2/myapp-error.log
      CustomLog /var/log/apache2/myapp-access.log common
  &lt;/VirtualHost&gt;
  </code></pre>
  <ul>
  <li>create service <code>/etc/systemd/system/myapp.service</code></li>
  </ul>
  <pre><code>[Unit]
  Description=MyApp .NET Web API running on CentOS
  [Service]
  WorkingDirectory=/var/netcore/myapp/
  ExecStart=/usr/bin/dotnet /var/netcore/myapp/myapp.dll
  Restart=always
  # Restart service after 10 seconds if the dotnet service crashes:
  RestartSec=10
  KillSignal=SIGINT
  SyslogIdentifier=myapp
  User=root
  Environment=ASPNETCORE_ENVIRONMENT=Production
  Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  <ul>
  <li>paths</li>
  <li>
  <blockquote>
  <p>SPA : /var/netcore/myapp/ClientApp/build</p>
  </blockquote>
  </li>
  <li>
  <blockquote>
  <p>Asp Net : /var/netcore/myapp</p>
  </blockquote>
  </li>
  </ul>