title: Reverse proxy in nginx for nextcloud?
body: <p>How do I set a reverse proxy for nextcloud?
  This is my current config but it doesn't work:</p>
  
  <pre><code>server {
    listen 8000;
    server_name cloud.prjctdesign.com;
    return 301 https://$host$request_uri;
  }
  
  server {
    listen 4430 ssl http2;
    server_name cloud.prjctdesign.com;
  
    ssl_certificate /certs/cloud.prjctdesign.com.crt;
    ssl_certificate_key /certs/cloud.prjctdesign.com.key;
  
    include /etc/nginx/conf/ssl_params.conf;
  
    client_max_body_size 10G; # change this value it according to $UPLOAD_MAX_SIZE
  
    location / {
      proxy_pass http://192.168.178.32;
      include /etc/nginx/conf/proxy_params;
    }
  }
  </code></pre>
  
  <p>Also I enabled SSL using a let's encrypt cert. I run Nextcloud in the official VM image provided by Nextcloud / Techandme</p>
  
  <p>I believe there is something wrong with the HSTS but I have no idea how it works. Also I based my forwarding off of <a href="https://hub.docker.com/r/wonderfall/nextcloud/" rel="nofollow noreferrer">this</a></p>