Nextcloud Pretty URLs with Caddy web server

Nextcloud supports pretty urls which is a fancy way of saying it will not display the ‘index.php’ part in the address bar. However its configuration assumes everyone is using the Apache web server and tries to utilize its .htaccess and rewrite mechanisms. Since some web servers like Nginx and Caddy do not provide these facilities, it won’t work without some settings.

How to enable Nextcloud pretty URLs when using the Caddy web server.

The configuration is pretty simple after you found the exact configuration option necessary. The following assumes you are using the php_fastcgi directive in Caddy. This directive is an ease of use function provided by Caddy which makes some assumptions regarding modern PHP setups. It does by default support rewriting index.php router urls so there is no configuration to be done on the Caddy side.

On the Nextcloud side add this configuration directive to your settings file.

'htaccess.IgnoreFrontController' => true

It’s a bit unfortunate that we have to use a parameter named htaccess when we don’t have such a thing, but it is what it is.

I am using a web proxy to take care of SAML based SSO. You may or may not need this setting if you’re serving your Nextcloud install directly.

206 Words

2022-01-09 00:00 +0000