title: Refresh page very long with Nginx as reverse proxy for Express and NuxtJs
body: <p>I configured my server with nginx as a reverse proxy for a Nuxt/Express SSR application. For the moment I have a login page, and a home page.</p>
  
  <p>I can connect and disconnect without any problem.</p>
  
  <p>However, when I'm connected and I refresh the page, the loading time is very long. </p>
  
  <p>I don't know if this is due to Nginx configuration or the authentication API or redirection. </p>
  
  <p>I've noticed that it also happens when I type my url myself in the address bar. </p>
  
  <p>Thanks in advance for your help</p>
  
  <p>Update : 
  Here is my nginx config </p>
  
  <pre><code>worker_processes  1;
  
  error_log  logs/error.log  info;
  
  events {
      worker_connections  1024;
  }
  
  
  http {
      include       mime.types;
      default_type  application/octet-stream;
  
      sendfile        on;
  
      keepalive_timeout  65;
  
      map_hash_max_size 64;
      map_hash_bucket_size 64;
      map $sent_http_content_type $expires {
          "text/html"                 epoch;
          "text/html; charset=utf-8"  epoch;
          default                     off;
      }
  
      server {
          listen       9998 ssl;
          server_name  control.serenicity.fr;
  
          ssl_certificate      "C:/nginx-1.19.0/ssl/mydomain.fr.crt";
          ssl_certificate_key  "C:/nginx-1.19.0/ssl/mydomain.fr.key";
  
  
          location / {
          expires $expires;
  
          proxy_redirect                      off;
          proxy_set_header Host               $host;
          proxy_set_header X-Real-IP          $remote_addr;
          proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto  $scheme;
          proxy_read_timeout          1m;
          proxy_connect_timeout       1m;
          proxy_pass                          http://10.0.5.11:3000; 
          }
  
          error_page   500 502 503 504  /50x.html;
          location = /50x.html {
              root   html;
          }
      }
  }
  </code></pre>
  
  <p>Here are the request when I refresh :
  <a href="https://drive.google.com/file/d/1PeHzCaHvLNL8_YN9ZOEFNv_gxQe2jpu9/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1PeHzCaHvLNL8_YN9ZOEFNv_gxQe2jpu9/view?usp=sharing</a>  </p>
  
  <p><a href="https://drive.google.com/file/d/1b9m3cDL_LOv1d3Kaaucnq4Qi308P8TLT/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1b9m3cDL_LOv1d3Kaaucnq4Qi308P8TLT/view?usp=sharing</a></p>
  
  <p><a href="https://drive.google.com/file/d/1xe_EBnb_XXWo7IlaI47EtlaLE6eFgd2k/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1xe_EBnb_XXWo7IlaI47EtlaLE6eFgd2k/view?usp=sharing</a> </p>
  
  <p>Update 2 :</p>
  
  <p>After several hours of debugging, it seems that there is no link with nginx. 
  The problem comes from nuxt in SSR. When I disable SSR there is no more problem.</p>