title: Symfony 4 & webpack encore in production env, my css and js generated files aren't loaded
body: <p>I want to deploy my Symfony 4 website in a production environment.
  I set the variable <code>APP_ENV</code>to <code>prod</code> (in the .env file), and I executed this command : <code>yarn build</code> ( = <code>./node_modules/.bin/encore production</code> )</p>
  
  <p>Then, I can see there are generated files in my public directory (files like by example : <code>public/build/css/global.9e04a9d9.css</code>, <code>public/build/js/global.399763b8.js</code>, ... )</p>
  
  <p>I can see also a manifest.json file in the <code>public/build</code> directory, its content is : </p>
  
  <pre><code>{
    "myApp/public/build/js/global.js": "/myApp/public/build/js/global.399763b8.js",
    "myApp/public/build/css/global.css": "/myApp/public/build/css/global.9e04a9d9.css"
  }
  </code></pre>
  
  <p>But when I load a page thought my browser (firefox), css and js files aren't loaded and I don't understand why.</p>
  
  <p>By example, in the browser debugger I get this 'notice' message : "Loading failed for the  with source “<a href="http://localhost/myApp/public/build/js/global.js" rel="nofollow noreferrer">http://localhost/myApp/public/build/js/global.js</a>”."</p>
  
  <p>And when I browse the code of my page (via firefox debugger), the paths of css and js are : </p>
  
  <pre><code>&lt;link rel="stylesheet" href="/myApp/public/build/css/global.css"&gt;
  ...
  &lt;script src="/myApp/public/build/js/global.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>The issue is here : Why <code>global.css</code> and <code>global.js</code> aren't <code>global.9e04a9d9.css</code> and <code>global.399763b8.js</code> ? </p>
  
  <ul>
  <li>I cleared caches with <code>bin/console cache:clear</code> (and I tried also with <code>bin/console cache:clear --env=prod</code>)</li>
  <li>I checked rights of var/cache and public/build directories (directories owned by www-data with read/write permission)</li>
  </ul>
  
  <p>Of course, in my template twig file, I generate theses paths with the function "asset" : </p>
  
  <pre><code>&lt;link rel="stylesheet" href="{{ asset('build/css/global.css') }}"&gt;
  ...
  &lt;script src="{{ asset('build/js/global.js') }}"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Where is my mistake ? </p>