Nginx subfolder configuration: 404 errors on icons

Nextcloud version 12.0.0:
Operating system and version Ubuntu 16.04:
Apache or nginx version nginx 1.10.0:
PHP version PHP 7.0.15-0ubuntu0.16.04.4:
Is this the first time you’ve seen this error?: Yes

####Can you reliably replicate it? (If so, please outline steps):

Yes (open up files app in browser with Nextcloud running under nginx)

The issue you are facing:

Multiple svg icons (including star.svg and folder.svg )do not appear when running Nextcloud under nginx with the subfolder configuration.

It looks like the configuration is attempting to serve svg files from root locations /core and /apps rather than /nextcloud/core and /nextcloud/apps. I’m very new to nginx. Suggestions welcome.

example errors from /var/log/nginx/error.log (ip address and host name changed):

2017/05/24 19:33:20 [error] 31475#31475: *1 open() "/var/www/html/core/img/actions/search-white.svg" failed (2: No such file or directory), client: gg.gg.gg.gg, server: gggg.com, request: "GET /core/img/actions/search-white.svg?v=1 HTTP/2.0", host: "gggg.com" 
2017/05/24 19:33:20 [error] 31475#31475: *1 open() "/var/www/html/core/img/places/contacts.svg" failed (2: No such file or directory), client: gg.gg.gg.gg, server: gggg.com, request: "GET /core/img/places/contacts.svg?v=1 HTTP/2.0", host: "gggg.com"
2017/05/24 19:33:20 [error] 31475#31475: *1 open() "/var/www/html/apps/files/img/folder.svg" failed (2: No such file or directory), client: gg.gg.gg.gg, server: gggg.com, request: "GET /apps/files/img/folder.svg?v=1 HTTP/2.0", host: "gggg.com"
2017/05/24 19:33:20 [error] 31475#31475: *1 open() "/var/www/html/apps/files/img/recent.svg" failed (2: No such file or directory), client: gg.gg.gg.gg, server: gggg.com, request: "GET /apps/files/img/recent.svg?v=1 HTTP/2.0", host: "gggg.com"

nginx site config file (site name changed): https://pastebin.com/s2yBXKVh

Nextcloud Log: (identifying information removed, no errors relevant to page rendering)

Warning core    Login failed: 'user' (Remote IP: 'xxx.xxx.xxx.xxx') 2017-05-24T18:45:28-0400
Warning core    Login failed: 'user' (Remote IP: 'xxx.xxx.xxx.xxx') 2017-05-24T18:44:54-0400
Error   PHP Undefined index: federationId at /var/www/html/nextcloud/settings/BackgroundJobs/VerifyUserData.php#234 2017-05-24T09:00:02-0400
Error   PHP Undefined index: federationId at /var/www/html/nextcloud/settings/BackgroundJobs/VerifyUserData.php#234 2017-05-24T07:45:07-0400
Error   PHP Undefined index: federationId at /var/www/html/nextcloud/settings/BackgroundJobs/VerifyUserData.php#234 2017-05-24T06:30:08-0400

nextcloud/config/config.php (site name and password salts removed): https://pastebin.com/Gpv9G1Jf

I can’t find a misconfiguration in the files you provided. Same configuration works here as expected. Maybe setting nginx error_log to debug (http://nginx.org/en/docs/ngx_core_module.html#error_log) will help to find out what is going wrong…

It’s pretty big. Is there a recommended way to share it?

Please post only the lines regarding the processing of a request e.g. for https://ggggg.com/nextcloud/apps/files/img/folder.svg?v=1

Here’s a typical 404 response, I think from start to finish:

2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 http header: "user-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 get indexed header name: 66
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 http header: "accept: */*"
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 get indexed header name: 65
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 http header: "accept-language: en-US,en;q=0.5"
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 get indexed header name: 64
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 http header: "accept-encoding: gzip, deflate, br"
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 get indexed header name: 109
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 get indexed header name: 108
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 get indexed header name: 107
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 get indexed header name: 106
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 get indexed header name: 105
2017/05/26 18:18:27 [debug] 24630#24630: *1 http2 http request line: "GET /apps/files/img/recent.svg?v=1 HTTP/2.0"
2017/05/26 18:18:27 [debug] 24630#24630: *1 generic phase: 0
2017/05/26 18:18:27 [debug] 24630#24630: *1 rewrite phase: 1
2017/05/26 18:18:27 [debug] 24630#24630: *1 test location: "/"
2017/05/26 18:18:27 [debug] 24630#24630: *1 test location: ".well-known/carddav"
2017/05/26 18:18:27 [debug] 24630#24630: *1 test location: "robots.txt"
2017/05/26 18:18:27 [debug] 24630#24630: *1 test location: "nextcloud"
2017/05/26 18:18:27 [debug] 24630#24630: *1 test location: ~ "\.php$"
2017/05/26 18:18:27 [debug] 24630#24630: *1 using configuration "/"
2017/05/26 18:18:27 [debug] 24630#24630: *1 http cl:-1 max:1048576
2017/05/26 18:18:27 [debug] 24630#24630: *1 rewrite phase: 3
2017/05/26 18:18:27 [debug] 24630#24630: *1 post rewrite phase: 4
2017/05/26 18:18:27 [debug] 24630#24630: *1 generic phase: 5
2017/05/26 18:18:27 [debug] 24630#24630: *1 generic phase: 6
2017/05/26 18:18:27 [debug] 24630#24630: *1 generic phase: 7
2017/05/26 18:18:27 [debug] 24630#24630: *1 access phase: 8
2017/05/26 18:18:27 [debug] 24630#24630: *1 access phase: 9
2017/05/26 18:18:27 [debug] 24630#24630: *1 access phase: 10
2017/05/26 18:18:27 [debug] 24630#24630: *1 post access phase: 11
2017/05/26 18:18:27 [debug] 24630#24630: *1 try files phase: 12
2017/05/26 18:18:27 [debug] 24630#24630: *1 content phase: 13
2017/05/26 18:18:27 [debug] 24630#24630: *1 content phase: 14
2017/05/26 18:18:27 [debug] 24630#24630: *1 content phase: 15
2017/05/26 18:18:27 [debug] 24630#24630: *1 content phase: 16
2017/05/26 18:18:27 [debug] 24630#24630: *1 content phase: 17
2017/05/26 18:18:27 [debug] 24630#24630: *1 http filename: "/var/www/html/apps/files/img/recent.svg"
2017/05/26 18:18:27 [debug] 24630#24630: *1 add cleanup: 000055B49ACCA118
2017/05/26 18:18:27 [error] 24630#24630: *1 open() "/var/www/html/apps/files/img/recent.svg" failed (2: No such file or directory), client: xxx.xxx.xxx.xxx, server: foo.com, request: "GET /apps/files/img/recent.svg?v=1 HTTP/2.0", host: "foo.com"
2017/05/26 18:18:27 [debug] 24630#24630: *1 http finalize request: 404, "/apps/files/img/recent.svg?v=1" a:1, c:1
2017/05/26 18:18:27 [debug] 24630#24630: *1 http special response: 404, "/apps/files/img/recent.svg?v=1"
2

And here’s a request that’s passed to fastcgi:

2017/05/27 11:48:17 [debug] 6900#6900: *3 http2 http request line: "GET /nextcloud/apps/files/ HTTP/2.0"
2017/05/27 11:48:17 [debug] 6900#6900: *3 generic phase: 0
2017/05/27 11:48:17 [debug] 6900#6900: *3 rewrite phase: 1
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: "/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ".well-known/carddav"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: "robots.txt"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: "nextcloud"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: "/nextcloud"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ~ "^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ~ "^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console)"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ~ "^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/)"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ~ "^/nextcloud/(?:updater|ocs-provider)(?:$|/)"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ~ "\.(?:css|js|woff|svg|gif)$"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ~ "\.(?:png|html|ttf|ico|jpg|jpeg)$"
2017/05/27 11:48:17 [debug] 6900#6900: *3 using configuration "/nextcloud"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http cl:-1 max:536870912
2017/05/27 11:48:17 [debug] 6900#6900: *3 rewrite phase: 3
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script regex: "^"
2017/05/27 11:48:17 [notice] 6900#6900: *3 "^" matches "/nextcloud/apps/files/", client: xxx.xxx.xxx.xxx, server: foo.com, request: "GET /nextcloud/apps/files/ HTTP/2.0", host: "foo.com"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "/nextcloud/index.php"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "/nextcloud/apps/files/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script regex end
2017/05/27 11:48:17 [notice] 6900#6900: *3 rewritten data: "/nextcloud/index.php/nextcloud/apps/files/", args: "", client: xxx.xxx.xxx.xxx, server: foo.com, request: "GET /nextcloud/apps/files/ HTTP/2.0", host: "foo.com"
2017/05/27 11:48:17 [debug] 6900#6900: *3 post rewrite phase: 4
2017/05/27 11:48:17 [debug] 6900#6900: *3 uri changes: 11
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: "/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ".well-known/carddav"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: "robots.txt"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: "nextcloud"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: "/nextcloud"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ~ "^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ~ "^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console)"
2017/05/27 11:48:17 [debug] 6900#6900: *3 test location: ~ "^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/)"
2017/05/27 11:48:17 [debug] 6900#6900: *3 using configuration "^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/)"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http cl:-1 max:536870912
2017/05/27 11:48:17 [debug] 6900#6900: *3 rewrite phase: 3
2017/05/27 11:48:17 [debug] 6900#6900: *3 post rewrite phase: 4
2017/05/27 11:48:17 [debug] 6900#6900: *3 generic phase: 5
2017/05/27 11:48:17 [debug] 6900#6900: *3 generic phase: 6
2017/05/27 11:48:17 [debug] 6900#6900: *3 generic phase: 7
2017/05/27 11:48:17 [debug] 6900#6900: *3 access phase: 8
2017/05/27 11:48:17 [debug] 6900#6900: *3 access phase: 9
2017/05/27 11:48:17 [debug] 6900#6900: *3 access phase: 10
2017/05/27 11:48:17 [debug] 6900#6900: *3 post access phase: 11
2017/05/27 11:48:17 [debug] 6900#6900: *3 try files phase: 12
2017/05/27 11:48:17 [debug] 6900#6900: *3 posix_memalign: 000055D44C26F1D0:4096 @16
2017/05/27 11:48:17 [debug] 6900#6900: *3 http body new buf t:0 f:0 0000000000000000, pos 0000000000000000, size: 0 file: 0, size: 0
2017/05/27 11:48:17 [debug] 6900#6900: *3 http init upstream, client timer: 0
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "QUERY_STRING"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "QUERY_STRING: "
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "REQUEST_METHOD"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "GET"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "REQUEST_METHOD: GET"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "CONTENT_TYPE"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "CONTENT_TYPE: "
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "CONTENT_LENGTH"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "0"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "CONTENT_LENGTH: 0"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "SCRIPT_NAME"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "/nextcloud/index.php"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "SCRIPT_NAME: /nextcloud/index.php"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "REQUEST_URI"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "/nextcloud/apps/files/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "REQUEST_URI: /nextcloud/apps/files/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "DOCUMENT_URI"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "/nextcloud/index.php/nextcloud/apps/files/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "DOCUMENT_URI: /nextcloud/index.php/nextcloud/apps/files/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "DOCUMENT_ROOT"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "/var/www/html"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "DOCUMENT_ROOT: /var/www/html"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "SERVER_PROTOCOL"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "HTTP/2.0"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "SERVER_PROTOCOL: HTTP/2.0"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "REQUEST_SCHEME"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "https"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "REQUEST_SCHEME: https"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "HTTPS"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "on"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "HTTPS: on"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "GATEWAY_INTERFACE"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "CGI/1.1"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "GATEWAY_INTERFACE: CGI/1.1"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "SERVER_SOFTWARE"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "nginx/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "1.10.0"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "SERVER_SOFTWARE: nginx/1.10.0"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "REMOTE_ADDR"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "xxx.xxx.xxx.xxx"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "REMOTE_ADDR: xxx.xxx.xxx.xxx"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "REMOTE_PORT"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "52826"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "REMOTE_PORT: 52826"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "SERVER_ADDR"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "172.26.8.175"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "SERVER_ADDR: 172.26.8.175"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "SERVER_PORT"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "443"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "SERVER_PORT: 443"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "SERVER_NAME"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "foo.com"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "SERVER_NAME: foo.com"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "REDIRECT_STATUS"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "200"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "REDIRECT_STATUS: 200"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "SCRIPT_FILENAME"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "/var/www/html"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "/nextcloud/index.php"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "SCRIPT_FILENAME: /var/www/html/nextcloud/index.php"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "PATH_INFO"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script var: "/nextcloud/apps/files/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "PATH_INFO: /nextcloud/apps/files/"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "HTTPS"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "on"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "HTTPS: on"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "modHeadersAvailable"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "true"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "modHeadersAvailable: true"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "front_controller_active"
2017/05/27 11:48:17 [debug] 6900#6900: *3 http script copy: "true"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "front_controller_active: true"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "HTTP_HOST: foo.com"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "HTTP_USER_AGENT: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.5"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "HTTP_ACCEPT_ENCODING: gzip, deflate, br"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "HTTP_UPGRADE_INSECURE_REQUESTS: 1"
2017/05/27 11:48:17 [debug] 6900#6900: *3 fastcgi param: "HTTP_COOKIE: nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; nc_username=kirk; nc_token=
2017/05/27 11:48:17 [debug] 6900#6900: *3 http cleanup add: 000055D44C26FA10
2017/05/27 11:48:17 [debug] 6900#6900: *3 get rr peer, try: 1
2017/05/27 11:48:17 [debug] 6900#6900: *3 stream socket 15
2017/05/27 11:48:17 [debug] 6900#6900: *3 epoll add connection: fd:15 ev:80002005
2017/05/27 11:48:17 [debug] 6900#6900: *3 connect to unix:/run/php/php7.0-fpm.sock, fd:15 #8
2017/05/27 11:48:17 [debug] 6900#6900: *3 connected
2017/05/27 11:48:17 [debug] 6900#6900: *3 http upstream connect: 0
2017/05/27 11:48:17 [debug] 6900#6900: *3 posix_memalign: 000055D44C1F9880:128 @16
2017/05/27 11:48:17 [debug] 6900#6900: *3 http upstream send request
2017/05/27 11:48:17 [debug] 6900#6900: *3 http upstream send request body
2017/05/27 11:48:17 [debug] 6900#6900: *3 chain writer buf fl:0 s:1568
2017/05/27 11:48:17 [debug] 6900#6900: *3 chain writer in: 000055D44C26FA48
2017/05/27 11:48:17 [debug] 6900#6900: *3 writev: 1568 of 1568
2017/05/27 11:48:17 [debug] 6900#6900: *3 chain writer out: 0000000000000000
2017/05/27 11:48:17 [debug] 6900#6900: *3 event timer add: 15: 60000:1495900157658
2017/05/27 11:48:17 [debug] 6900#6900: *3 http finalize request: -4, "/nextcloud/index.php/nextcloud/apps/files/?" a:1, c:2

Addresses have been changed, and I deleted the cookie from the log.

Sorry for not being clear enough. I’d be interested in requesting [quote=“Bernie_O, post:4, topic:13111”]
https://ggggg.com/nextcloud/apps/files/img/folder.svg?v=1
[/quote]
If you enter that link in your browser: does folder.svg show up, or is there a redirect to https://gggggg.com/apps/files/img/folder.svg resulting in a 404?

If it is resulting in a 404:

  • maybe the request is served by a different server-configuration: do you use only one nginx-server configuration file or are there several ones in /etc/nginx/sites-enabled?
  • can you post the debug output of nginx for requesting that file?

If it is displayed this doesn’t seem to be a nginx-configuration issue to me:
Have you tried with a fresh Installation of Nextcloud?

  • Rename your Nextcloud-folder to nextcloud-original
  • Download Nextcloud, unpack it and move the folder to /var/www/html/
  • navigate your browser to https://gggggg.com/nextloud and Install Nextcloud with sqlite (less complicated since this is only a test)
  • are the svg-files displayed?

Entering the path to the file manually works with no issues. The error log is at the bottom of the message.

No additional nginx configs. I also upgraded nginx to 1.12 to see if that was an issue. And I restarted with a fresh Nextcloud install.

2017/05/29 08:38:51 [debug] 13636#13636: *1 http2 http request line: "GET /nextcloud/nextcloud/apps/files/img/folder.svg?v=1 HTTP/2.0"
2017/05/29 08:38:51 [debug] 13636#13636: *1 generic phase: 0
2017/05/29 08:38:51 [debug] 13636#13636: *1 rewrite phase: 1
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: "/"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: ".well-known/carddav"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: "robots.txt"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: "nextcloud"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: "/nextcloud"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: ~ "^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: ~ "^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console)"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: ~ "^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/)"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: ~ "^/nextcloud/(?:updater|ocs-provider)(?:$|/)"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: ~ "\.(?:css|js|woff|svg|gif)$"
2017/05/29 08:38:51 [debug] 13636#13636: *1 using configuration "\.(?:css|js|woff|svg|gif)$"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http cl:-1 max:536870912
2017/05/29 08:38:51 [debug] 13636#13636: *1 rewrite phase: 3
2017/05/29 08:38:51 [debug] 13636#13636: *1 post rewrite phase: 4
2017/05/29 08:38:51 [debug] 13636#13636: *1 generic phase: 5
2017/05/29 08:38:51 [debug] 13636#13636: *1 generic phase: 6
2017/05/29 08:38:51 [debug] 13636#13636: *1 generic phase: 7
2017/05/29 08:38:51 [debug] 13636#13636: *1 access phase: 8
2017/05/29 08:38:51 [debug] 13636#13636: *1 access phase: 9
2017/05/29 08:38:51 [debug] 13636#13636: *1 access phase: 10
2017/05/29 08:38:51 [debug] 13636#13636: *1 post access phase: 11
2017/05/29 08:38:51 [debug] 13636#13636: *1 try files phase: 12
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "/nextcloud/nextcloud/apps/files/img/folder.svg"
2017/05/29 08:38:51 [debug] 13636#13636: *1 trying to use file: "/nextcloud/nextcloud/apps/files/img/folder.svg" "/var/www/html/nextcloud/nextcloud/apps/files/img/folder.svg"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "/nextcloud/index.php"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "/nextcloud/nextcloud/apps/files/img/folder.svg"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "?"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "v=1"
2017/05/29 08:38:51 [debug] 13636#13636: *1 trying to use file: "/nextcloud/index.php/nextcloud/nextcloud/apps/files/img/folder.svg?v=1" "/var/www/html/nextcloud/index.php/nextcloud/nextcloud/apps/files/img/folder.svg?v=1"
2017/05/29 08:38:51 [debug] 13636#13636: *1 internal redirect: "/nextcloud/index.php/nextcloud/nextcloud/apps/files/img/folder.svg?v=1"
2017/05/29 08:38:51 [debug] 13636#13636: *1 rewrite phase: 1
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: "/"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: ".well-known/carddav"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: "robots.txt"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: "nextcloud"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: "/nextcloud"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: ~ "^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: ~ "^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console)"
2017/05/29 08:38:51 [debug] 13636#13636: *1 test location: ~ "^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/)"
2017/05/29 08:38:51 [debug] 13636#13636: *1 using configuration "^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/)"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http cl:-1 max:536870912
2017/05/29 08:38:51 [debug] 13636#13636: *1 rewrite phase: 3
2017/05/29 08:38:51 [debug] 13636#13636: *1 post rewrite phase: 4
2017/05/29 08:38:51 [debug] 13636#13636: *1 generic phase: 5
2017/05/29 08:38:51 [debug] 13636#13636: *1 generic phase: 6
2017/05/29 08:38:51 [debug] 13636#13636: *1 generic phase: 7
2017/05/29 08:38:51 [debug] 13636#13636: *1 access phase: 8
2017/05/29 08:38:51 [debug] 13636#13636: *1 access phase: 9
2017/05/29 08:38:51 [debug] 13636#13636: *1 access phase: 10
2017/05/29 08:38:51 [debug] 13636#13636: *1 post access phase: 11
2017/05/29 08:38:51 [debug] 13636#13636: *1 try files phase: 12
2017/05/29 08:38:51 [debug] 13636#13636: *1 http body new buf t:0 f:0 0000000000000000, pos 0000000000000000, size: 0 file: 0, size: 0
2017/05/29 08:38:51 [debug] 13636#13636: *1 http init upstream, client timer: 0
2017/05/29 08:38:51 [debug] 13636#13636: *1 posix_memalign: 000055A1CC17B150:4096 @16
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "QUERY_STRING"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "v=1"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "QUERY_STRING: v=1"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "REQUEST_METHOD"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "GET"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "REQUEST_METHOD: GET"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "CONTENT_TYPE"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "CONTENT_TYPE: "
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "CONTENT_LENGTH"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "CONTENT_LENGTH: "
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "SCRIPT_NAME"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "/nextcloud/index.php"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "SCRIPT_NAME: /nextcloud/index.php"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "REQUEST_URI"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "/nextcloud/nextcloud/apps/files/img/folder.svg?v=1"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "REQUEST_URI: /nextcloud/nextcloud/apps/files/img/folder.svg?v=1"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "DOCUMENT_URI"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "/nextcloud/index.php/nextcloud/nextcloud/apps/files/img/folder.svg"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "DOCUMENT_URI: /nextcloud/index.php/nextcloud/nextcloud/apps/files/img/folder.svg"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "DOCUMENT_ROOT"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "/var/www/html"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "DOCUMENT_ROOT: /var/www/html"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "SERVER_PROTOCOL"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "HTTP/2.0"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "SERVER_PROTOCOL: HTTP/2.0"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "REQUEST_SCHEME"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "https"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "REQUEST_SCHEME: https"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "HTTPS"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "on"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "HTTPS: on"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "GATEWAY_INTERFACE"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "CGI/1.1"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "GATEWAY_INTERFACE: CGI/1.1"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "SERVER_SOFTWARE"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "nginx/"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "1.12.0"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "SERVER_SOFTWARE: nginx/1.12.0"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "REMOTE_ADDR"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "69.41.96.247"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "REMOTE_ADDR: 69.41.96.247"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "REMOTE_PORT"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "44598"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "REMOTE_PORT: 44598"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "SERVER_ADDR"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "172.26.8.175"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "SERVER_ADDR: 172.26.8.175"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "SERVER_PORT"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "443"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "SERVER_PORT: 443"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "SERVER_NAME"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "ggggg.com"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "SERVER_NAME: ggggg.com"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "REDIRECT_STATUS"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "200"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "REDIRECT_STATUS: 200"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "SCRIPT_FILENAME"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "/var/www/html"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "/nextcloud/index.php"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "SCRIPT_FILENAME: /var/www/html/nextcloud/index.php"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "PATH_INFO"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script var: "/nextcloud/nextcloud/apps/files/img/folder.svg"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "PATH_INFO: /nextcloud/nextcloud/apps/files/img/folder.svg"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "HTTPS"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "on"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "HTTPS: on"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "modHeadersAvailable"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "true"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "modHeadersAvailable: true"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "front_controller_active"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http script copy: "true"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "front_controller_active: true"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "HTTP_HOST: ggggg.com"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.5"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "HTTP_ACCEPT_ENCODING: gzip, deflate, br"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "HTTP_UPGRADE_INSECURE_REQUESTS: 1"
2017/05/29 08:38:51 [debug] 13636#13636: *1 fastcgi param: "HTTP_COOKIE: nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; nc_username=kirk; nc_token=JV%2BH1mPFyTX7R2lfRW87BJvsLFoFMmcs; nc_session_id=09mtofso44dophecff4sjtkuc6; oc56ttkc6ldo=09mtofso44dophecff4sjtkuc6; oc_sessionPassphrase=lvbb9fefXftBzqAyDB8HevPKsmmu3q0jkQ1Nf5rFF%2BIGNktvmkmGOcmVUONzafjVZiwg3z1te0MNQ75aV9Dj%2Fq%2FWMCJLyCQxBnQTaTOOJaz5Gbvcm%2B1M90EzWc988kbG; csrftoken=XqDru0W5WddWbMYGIPXg8dulJU8d0K9W"
2017/05/29 08:38:51 [debug] 13636#13636: *1 http cleanup add: 000055A1CC17B7D8
2017/05/29 08:38:51 [debug] 13636#13636: *1 get rr peer, try: 1
2017/05/29 08:38:51 [debug] 13636#13636: *1 stream socket 13
2017/05/29 08:38:51 [debug] 13636#13636: *1 epoll add connection: fd:13 ev:80002005
2017/05/29 08:38:51 [debug] 13636#13636: *1 connect to unix:/run/php/php7.0-fpm.sock, fd:13 #37
2017/05/29 08:38:51 [debug] 13636#13636: *1 connected
2017/05/29 08:38:51 [debug] 13636#13636: *1 http upstream connect: 0
2017/05/29 08:38:51 [debug] 13636#13636: *1 posix_memalign: 000055A1CC107090:128 @16
2017/05/29 08:38:51 [debug] 13636#13636: *1 http upstream send request
2017/05/29 08:38:51 [debug] 13636#13636: *1 http upstream send request body
2017/05/29 08:38:51 [debug] 13636#13636: *1 chain writer buf fl:0 s:1464
2017/05/29 08:38:51 [debug] 13636#13636: *1 chain writer in: 000055A1CC17B818
2017/05/29 08:38:51 [debug] 13636#13636: *1 writev: 1464 of 1464
2017/05/29 08:38:51 [debug] 13636#13636: *1 chain writer out: 0000000000000000
2017/05/29 08:38:51 [debug] 13636#13636: *1 event timer add: 13: 60000:1496061591462
2017/05/29 08:38:51 [debug] 13636#13636: *1 http finalize request: -4, "/nextcloud/index.php/nextcloud/nextcloud/apps/files/img/folder.svg?v=1" a:1, c:3
2

[quote=“kirkjs, post:7, topic:13111”]Entering the path to the file manually works with no issues.[/quote]Then I don’t think the nginx-configuration is responsible for not displaying the images.

This looks like you installed Nextcloud within the subfolder nextcloud of the webroot. This won’t work reliably with the nginx-configuration provided (and this wasn’t the case with your original installation from your first post in this thread).
Possibly you moved the unzipped folder to /var/www/html/nextcloud/ (instead of /var/www/html/) resulting in nextclouds index.php being at /var/www/html/nextcloud/nextcloud/index.php

Can you install nextcloud again and make sure nextclouds index.php is at /var/www/html/nextcloud/index.php

  • Make sure the webserver-user (e.g. www-data) is owner of the folder nextcloud (chown -R www-data:www-data /var/www/html/nextcloud)
  • Are the svg images displayed after you login to the new installation?
  • Output of nginx-debug log is probably only needed, if requesting https://gggg.com/nextcloud/apps/files/img/folder.svg throws a 404 error.

That’s weird, because the folder /var/www/html/nextcloud/nextcloud doesn’t exist on my install. It’s a fresh install, and a direct link to /nextcloud/apps/files/img/folder.svg?v=1 delivers the file. Also I don’t have a problem if I run the same site under apache2 (although I don’t get pretty urls.) I’m primarily curious as to the source of the error. My suspicion is that php7.0-fpm or nextcloud isn’t getting or isn’t processing the subfolder location properly and directing the browser to the root of the site.

The key problem from what I can tell is why is the browser sending requests for https://sitename/apps... instead of https://sitename/nextcloud/apps?

I agree. Since the request is processed correctly when entering the path directly, I don’t think this is an nginx configuration issue. The same configuration works here as it should. I don’t use php7.0-fpm though.
What does the php-log say?

Have you been able to solve the issue meanwhile?

If not: here is another thread with a simmilar issue and suggested solutions. Maybe that could help in your case as well:

I got apache working with no problems and have not had the time to set
up a sandbox to experiment with nginx configs.

I think it was some configuration problem. Maybe try to create a symbolic link in your webroot dir that references to the webroot dir itself (/nextcloud_subdir --> .). The reason could be this bug.