Добрый день, столкнулся с проблемой подключения Collabora в Nginx.
Нашел что надо прописать в location директиву richdocumentscode/proxy, но то ли я не пойму как правильно строится синтаксис location, то ли еще что то, но после того как прописываю richdocumentscode/proxy, вместо того что бы открывать сайт, он у меня предлагает постоянно что либо скачать.
Good afternoon, faced with the problem of connecting Collabora to Nginx.
I found that I have to write the richdocumentscode/proxy directive to the location, but either I don’t understand how the location syntax is built correctly or something else, but after I write richdocumentscode/proxy, instead of opening the site, he offers me something to download all the time.
Конфиг\Config
server {
listen 443 ssl;
server_name site.ru;
ssl_certificate /etc/letsencrypt/live/site.ru/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/site.ru/privkey.pem; # managed by Certbot
root /var/www/html/nextcloud;
access_log /var/log/nginx/site_access.log;
error_log /var/log/nginx/site_error.log;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
client_max_body_size 10G;
fastcgi_buffers 64 4K;
rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
index index.php;
error_page 403 = /core/templates/403.php;
error_page 404 = /core/templates/404.php;
include acme;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
location / {
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
try_files $uri $uri/ index.php;
}
location ~ ^(.+?\.php)(/.*)?$ {
try_files $1 = 404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_param PATH_INFO $2;
fastcgi_param HTTPS on;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
}
location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires modified +30d;
access_log off;
}
location = /.well-known/carddav {
return 301 https://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 https://$host/remote.php/dav;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}