0

How do I set a reverse proxy for nextcloud? This is my current config but it doesn't work:

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;
  }
}

Also I enabled SSL using a let's encrypt cert. I run Nextcloud in the official VM image provided by Nextcloud / Techandme

I believe there is something wrong with the HSTS but I have no idea how it works. Also I based my forwarding off of this

4

1 回答 1

0

我想到了。对 ssl 证书的引用不正确。在运行 nextcloud 的同一台服务器上运行 NGINX 并将 nginx 重定向到 .cert 文件的位置,如下所示:

 ssl_certificate /certs/cloud.prjctdesign.com.crt;
 ssl_certificate_key /certs/cloud.prjctdesign.com.key;

或者在 nginx 服务器上生成一个新证书并将配置指向它。

于 2017-04-02T11:09:53.383 回答