How to configure nginx for PicoCMS on NC13 installed with docker

I have installed Docker CMS on NC13 (with OnlyOffice) with docker and nginx. The default installation propose these changes in the Apache configuration.

Using MOD_PROXY:
ProxyPass /sites/ http://cloud.mydomain.com/index.php/apps/cms_pico/pico/
ProxyPassReverse /sites/ http://cloud.mydomain.com/index.php/apps/cms_pico/pico/

Using MOD_REWRITE:
http://cloud.mydomain.com/index.php/apps/cms_pico/pico/example/
RewriteEngine On
RewriteRule /sites/(.*) http://cloud.mydomain.com/index.php/apps/cms_pico/pico/$1 [QSA,L]

Using MOD_REWRITE och MOD_PROXY:
http://cloud.mydomain.com/sites/example/
RewriteEngine On
RewriteRule /sites/(.*) http://cloud.mydomain.com/index.php/apps/cms_pico/pico/$1 [P]

I have tried one solution for nginx proposed here https://github.com/nextcloud/cms_pico/issues/24

location /sites/ {
rewrite /sites/(.*) /apps/cms_pico/pico/$1 break;
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-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_pass https://sub.domain.tld/;
}

but I could not get it working

I am a bit confused at the maptree does not look the same in my set up as in the examples above.

I have 2 pico folders (one pico and one Pico).

/var/lib/docker/volumes/dockeronlyofficeowncloud_app_data/_data/custom_apps/cms_pico/vendor/picocms/pico

/var/lib/docker/volumes/dockeronlyofficeowncloud_app_data/_data/custom_apps/cms_pico/Pico

I need help to set up the nginx configuration.

1 Like