Icons missing / path not rewritten

I am operating nextcloud behind a haproxy/firewall configuration. This configuration will only allow requests like


All is working but some icons are missing. Looking at it with Inspector I see that it is requesting the svgs from


instead of


I tried

‘overwritewebroot’ => ‘/nextcloud’,
‘htaccess.RewriteBase’ => ‘/nextcloud’,

and ran maintenance. .htaccess is changed. However it still is not working. This is with apache24. What am I missing?


Have you also set the url in (should normally only be related to links created by php-cli->cronjobs):
'overwrite.cli.url' => 'https://example.org/nextcloud',

Also verify that:

  • mod_rewrite is installed & enabled
  • mod_env is installed & enabled

mod_rewrite and mod_env are installed. overwrite.cli.url was there the entire time. I spend several hours debugging and looking through related articles so I hope I can rule out the obvious… :slight_smile:

How does your apache-settings look like? Did you put an AllowOverride all for the nextcloud directory in order to activate the .htaccess settings?
Other links to specific apps or folder work? You are on version 10.0.1? It happens on all browsers?

.htaccess is working (eg the X-Headers are set). Yes it happens in all browsers. Since the links are simply incorrect I fail to see how different browsers would behave differently.

Can you locally access your setup without proxy and see if the nextcloud/-folder is correctly set?

Sure. The prefix is missing as well. But only for these SVG images. All the rest is fine.

I can report the same issue. Even without a proxy.

I just installed version 11.0 on a new VM. I originally set Apache2 up with a site configuration (virtual server) before setting up Nextcloud, then I changed my mind and altered that to a conf configuration (in the default virtual server) with an alias putting Nextcloud into /nextcloud instead of the root.

It has broken the image files in the drop down menus, but everything else (file upload/download/admin pages/files app/gallery app etc) seems to work. It looks like whatever generates the images isn’t respecting the path everything else does.

e.g. the webserver presents /settings/img/personal.svg to my browser (404 error)
If I edit to /nextcloud/settings/img/personal.svg then the picture comes up.

I have this in my config.php:

  'overwritewebroot' => '/nextcloud',
  'overwrite.cli.url' => '/nextcloud',

Is there any other info i could give that would help diagnose?

overwrite.cli.url needs to be the full URL as stated in the sample config:

Hi there.

I just gave this a try and it didn’t change the behaviour I’m seeing. The documentation says that setting is for “using any kind of command line tools (cron or occ)”.

Out of interest, I tested putting the full URL into ‘overwritewebroot’ as well and that clearly didn’t work (turned URLs into “https://host.domain.com/nextcloud/https://host.domain.com/nextcloud/blah”).

Is there anything else I can try or logs I can produce? What generates the images path?

Current config:

  'overwritewebroot' => '/nextcloud',
  'overwrite.cli.url' => 'https://www.domain.tld/nextcloud',

Apache2 conf:
Alias /nextcloud "/var/www/nextcloud/"

<Directory "/var/www/nextcloud">
Options +FollowSymLinks
AllowOverride All

<IfModule mod_dav.c>
  Dav off

SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud

Satisfy Any


I did some more digging. Looking at the source of the HTML, most paths have /nextcloud but some don’t.

		<link rel="icon" href="/core/img/favicon.ico">
	<link rel="apple-touch-icon-precomposed" href="/core/img/favicon-touch.png">
	<link rel="mask-icon" sizes="any" href="/core/img/favicon-mask.svg" color="#0082c9">
				<link rel="stylesheet" href="/nextcloud/core/vendor/select2/select2.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/styles.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/header.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/icons.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/fonts.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/apps.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/global.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/fixes.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/multiselect.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/mobile.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/vendor/jquery-ui/themes/base/jquery-ui.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/jquery-ui-fixes.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/tooltip.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files_pdfviewer/css/style.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/share.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files_versions/css/versions.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files_videoplayer/css/style.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/gallery/css/slideshow.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/gallery/css/gallerybutton.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/notifications/css/styles.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/inputs.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/jquery.ocdialog.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files/css/files.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files/css/upload.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files/css/mobile.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files/css/detailsView.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files_external/css/external.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files_trashbin/css/trash.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/activity/css/style.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/comments/css/comments.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files_sharing/css/sharetabview.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files_sharing/css/sharebreadcrumb.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files_texteditor/css/DroidSansMono/stylesheet.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files_texteditor/css/style.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/files_texteditor/css/mobile.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/core/css/systemtags.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
				<link rel="stylesheet" href="/nextcloud/apps/systemtags/css/systemtagsfilelist.css?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">


					<a href="/nextcloud/index.php/settings/personal"
						<img alt="" src="/settings/img/personal.svg?v=1f3ea9a570b4a33a8efbfc4c67d1fa4e">
						Personal						</a>

Nobody? It’s got me blocked for rollout at the moment.

Could it be to do with the fact that it was at / when the installer ran? Is there a path stored in the database or a settings file somewhere else?

Did you restart your webserver and the caches, also your web browsers. Normally this should do the job.

Thanks for the suggestion.

I stopped Apache2, ran htcacheclean and restarted it. I cleared Chrome’s history/cache completely and tried again (and from a new browser on a different machine). Same result.

Given that the HTML being delivered to the browser contains incorrect paths to the images, then it doesn’t feel like a caching issue. It feels more like a bug?

There is also a report about theming and the favicon.ico:

(in this case the occ-htaccess-code helped, but you ran that already: Missing favicon)

So it’s perhaps a bug.

I hadn’t tried that setting, so I just did (and ran sudo -u www-data php occ maintenance:update:htaccess).

Still no improvement.

My config.php has:

  'overwritewebroot' => '/nextcloud',
  'overwrite.cli.url' => 'https://www.domain.tld/nextcloud',
  'htaccess.RewriteBase' => '/nextcloud',

My .htaccess snippet looks like this:

ErrorDocument 403 /nextcloud/core/templates/403.php
ErrorDocument 404 /nextcloud/core/templates/404.php
<IfModule mod_rewrite.c>
  Options -MultiViews
  RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
  RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
  RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$
  RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
  RewriteCond %{REQUEST_FILENAME} !/remote.php
  RewriteCond %{REQUEST_FILENAME} !/public.php
  RewriteCond %{REQUEST_FILENAME} !/cron.php
  RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
  RewriteCond %{REQUEST_FILENAME} !/status.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
  RewriteCond %{REQUEST_FILENAME} !/updater/
  RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule . index.php [PT,E=PATH_INFO:$1]
  RewriteBase /nextcloud
  <IfModule mod_env.c>
    SetEnv front_controller_active true
    <IfModule mod_dir.c>
      DirectorySlash off

I don’t mind hand-editing the theme file or whatever calls the theme images if I could work out where it was!

Out of interest, I installed the two themes from here just in case there was a bug in the main theme but it didn’t fix the image paths (which must be defined elsewhere?):

Out of interest, I installed a new, fresh Nextcloud into /nextcloud2 (i.e., installed already not at the web root). It installed fine and the icons are all displaying. I had a look at config.php and .htaccess and couldn’t see anything very different.

I can (and will) proceed by deleting my planned installation and reinstalling, but I feel there is something out there to fix at some point.

Good that it works, however it is strange that it doesn’t work for the other setup. Open perhaps a bug report on github. Only thing I could still think of is that in the *_storage(s)-table the path to the data-directory is wrong. But I can’t imagine that this is related to the favicon.ico-error.

Hi, I have the same issue of several icons in Files App not being retrieved (404 from server, eg. /s/img/folder.svg?v=1), currently in NC12. Has there been some progress in this issue lately?

I fixed the problem with direct editing CSS definitions for the icons in Files App in the file apps/files/css/files.scss. The urls needed to be changed from …/img/[image].svg to …/…/apps/files/img/[image].svg.

Ran into the same problem, just AFTER adding 'htaccess.RewriteBase' => '/nextcloud', and sudo -u www-data php occ maintenance:update:htaccess.

Interesting is, that enabling the theming app fixes the issue: All icons are shown again.

‘overwritewebroot’ => ‘/nextcloud’,
‘theme’ => ‘’,

etc. trying back and forth didn’t solve the problem. So using index.php-less URL seems to somehow break the default (non app) theming, making nextcloud looking for the related svg files in web root instread of /nextcloud.

1 Like