[Bug]: Wrong links and image URL in email (subfolder twice)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
email notifications do not show the logo, because the image path is not correct.
I run nextcloud docker behind nginx reverse proxy. Nextcloud is running in a subdirectory: https://cloud.my-domain.org/mynextcloud/
The image URL in the notification is: <img class=3D"logo float-center" src=3D"https://cloud.my-domain.org/mynextcloud/mynextcloud/index.php/apps/theming/image/logo?useSvg=3D0&=v=3D260" alt=.... You can see that the subdirectory is twice in the path. If the email is an upload notification, the referenced files have this effect, too. Only the first link correctly references to the server URL (https://cloud.my-domain.org/mynextcloud/).
In my config.php, I have defined:
'overwrite.cli.url' => 'https://cloud.my-domain.org/mynextcloud/',
'overwritewebroot' => '/mynextcloud',
'overwriteprotocol' => 'https',
'htaccess.RewriteBase' => '/mynextcloud',
'theme' => '',
The parameter htaccess.RewriteBase I have tried with => '/' and => '/mynextcloud'.
Because everything else is working fine, I believe that .htaccess and nginx config are good, and suspect the issue somewhere in my server/theming app.
Steps to reproduce
- install nextcloud in a subdirectory behind an nginx reverse proxy
- activate notification emails for shared folder uploads (or any other event)
- upload a file to initiate a notification email
- check email and contained header image or referenced file links
Expected behavior
The image is correctly shown and links to the uploaded files are working.
Nextcloud Server version
31
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.3
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
{
"system": {
"memcache.local": "\\OC\\Memcache\\APCu",
"apps_paths": [
{
"path": "\/var\/www\/html\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/www\/html\/custom_apps",
"url": "\/custom_apps",
"writable": true
}
],
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"overwrite.cli.url": "https:\/\/cloud.mydomain.org\/mynextcloud\/",
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"cloud.mydomain.org",
"cloud.myotherdomain.de",
"cloud.myotherdomain.fr"
],
"overwritewebroot": "\/mynextcloud",
"overwriteprotocol": "https",
"htaccess.RewriteBase": "\/mynextcloud",
"dbtype": "mysql",
"version": "31.0.7.1",
"installed": true,
"mail_smtpmode": "smtp",
"mail_smtpauthtype": "PLAIN",
"loglevel": 0,
"maintenance": false,
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauth": 1,
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "2525",
"theme": "",
"app_install_overwrite": [
"polls",
"unsplash",
"social",
"keeporsweep",
"bookmarks_fulltextsearch",
"bookmarks",
"groupfolders",
"tasks",
"forms",
"cookbook",
"gpoddersync",
"news"
],
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
"mysql.utf8mb4": true,
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"default_locale": "en_US",
"default_phone_region": "DE",
"memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/exiftool-bin\/exiftool-amd64-glibc",
"mail_sendmailmode": "smtp",
"simpleSignUpLink.shown": false
}
}
List of activated Apps
Enabled:
- activity: 4.0.0
- admin_audit: 1.21.0
- app_api: 5.0.2
- bookmarks: 15.1.3
- bruteforcesettings: 4.0.0
- calendar: 5.3.8
- circles: 31.0.0
- cloud_federation_api: 1.14.0
- comments: 1.21.0
- contacts: 7.2.3
- contactsinteraction: 1.12.0
- cookbook: 0.11.3
- cospend: 3.0.11
- dav: 1.33.0
- federatedfilesharing: 1.21.0
- federation: 1.21.0
- files: 2.3.1
- files_downloadlimit: 4.0.0
- files_external: 1.23.0
- files_pdfviewer: 4.0.0
- files_reminders: 1.4.0
- files_sharing: 1.23.1
- firstrunwizard: 4.0.0
- flow_notifications: 2.0.1
- forms: 5.1.2
- gpoddersync: 3.12.0
- groupfolders: 19.1.3
- logreader: 4.0.0
- lookup_server_connector: 1.19.0
- mail: 5.1.10
- news: 26.1.0
- nextcloud_announcements: 3.0.0
- notes: 4.12.2
- notifications: 4.0.0
- oauth2: 1.19.1
- password_policy: 3.0.0
- photos: 4.0.0
- polls: 8.1.4
- privacy: 3.0.0
- profile: 1.0.0
- provisioning_api: 1.21.0
- recognize: 9.0.3
- recommendations: 4.0.0
- related_resources: 2.0.0
- serverinfo: 3.0.0
- settings: 1.14.0
- sharebymail: 1.21.0
- support: 3.0.0
- systemtags: 1.21.1
- tasks: 0.16.1
- text: 5.0.0
- theming: 2.6.1
- twofactor_backupcodes: 1.20.0
- twofactor_totp: 13.0.0-dev.0
- updatenotification: 1.21.0
- user_status: 1.11.0
- viewer: 4.0.0
- weather_status: 1.11.0
- webhook_listeners: 1.2.0
- workflowengine: 2.13.0
Disabled:
- dashboard: 7.11.0 (installed 7.10.0)
- encryption: 2.19.0 (installed 2.6.0)
- files_automatedtagging: 2.0.0 (installed 2.0.0)
- files_rightclick: 0.15.1 (installed 1.6.0)
- files_trashbin: 1.21.0 (installed 1.8.0)
- files_versions: 1.24.0 (installed 1.18.0)
- maps: 1.6.0 (installed 1.6.0)
- social: 0.7.0 (installed 0.7.0)
- spreed: 21.1.2 (installed 21.1.2)
- survey_client: 3.0.0 (installed 1.2.0)
- suspicious_login: 9.0.1
- twofactor_nextcloud_notification: 5.0.0
- unsplash: 3.1.0 (installed 3.1.0)
- user_ldap: 1.22.0 (installed 1.8.0)
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the email notification with Nextcloud installed under /mynextcloud and inspect the generated logo and uploaded-file URLs. Trace URL generation in the theming and notification email paths, compare the first correct link with the duplicated subdirectory paths, and consider the issue done when both image and file links work from the subdirectory deployment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, mariadb, nginx, php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100