title: Nuxt static generated page and axios post
body: <p>I have a Nuxt project. Everything is OK when I generate a static page.
  However, I need to send a POST request to the other server.</p>
  
  <p>I tried to use both a proxy in nuxt.config.js and just direct query, but after deploy to the ngnix eventually, nothing works.</p>
  
  <p>Please help.</p>
  
  <hr>
  
  <p>UPDATE. Steps to reproduce.</p>
  
  <ul>
  <li>Create Nuxt App including axios and proxy</li>
  <li>Configure your proxy for other webservice:</li>
  </ul>
  
  <p><code>proxy: {
      '/api': {
        target: 'http://example.com:9000',
        pathRewrite: {
          '^/api': '/',
        },
      },
      changeOrigin: true,
    },</code></p>
  
  <ul>
  <li><p>call this service somewhere in the code: </p>
  
  <p><code>const result = await this.$axios.post('/api/email/subscribe', {email: email})</code></p></li>
  <li><p>run "yarn dev" and test the service. It works locally properly.</p></li>
  <li>run 'nuxt generate' and deploy the static code hosting service, for example, hosting.com</li>
  <li>run your page which calls the above-mentioned service.</li>
  </ul>
  
  <p>As a result, instead of making POST call to the <code>hosting.com/api/email/subscribe</code>, it calls <code>localhost:3000/api/email/subscribe</code>.</p>