Php files are not loaded but rather DOWNloaded on Nginx

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2):
Operating system and version (eg, Ubuntu 17.04):
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1):

The issue you are facing:

Index page does not, it tries to download.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Copy the config from then new installation guide to nginx
  2. Go to the website

The output of your Nextcloud log in Admin > Logging:
Don;t have access to website


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '????',
  'passwordsalt' => '????',
  'secret' => '????,
  'trusted_domains' => 
  array (
   ? => '???',
  ),
  'datadirectory' => '/??/??',
  'dbtype' => 'mysql',
  'version' => '17.0.0.9',
  'overwrite.cli.url' => '???',
  'dbname' => '???',
  'dbhost' => '????',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '????',
  'dbpassword' => '???',
  'installed' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

172.104.242.173 - - [02/Nov/2019:19:01:30 -0400] "9\xCD\xC3V\x8C&\x12Dz/\xB7\xC0t\x96C\xE2" 400 157 "-" "-"
80.82.77.139 - - [02/Nov/2019:19:51:45 -0400] "GET / HTTP/1.1" 200 156 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36"
80.82.77.139 - - [02/Nov/2019:19:51:46 -0400] "GET /index.php HTTP/1.1" 200 3172 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36"
80.82.77.139 - - [02/Nov/2019:19:51:51 -0400] "" 400 0 "-" "-"
80.82.77.139 - - [02/Nov/2019:19:51:53 -0400] "" 400 0 "-" "-"
80.82.77.139 - - [02/Nov/2019:19:51:53 -0400] "" 400 0 "-" "-"
80.82.77.139 - - [02/Nov/2019:19:51:54 -0400] "" 400 0 "-" "-"
80.82.77.139 - - [02/Nov/2019:19:51:59 -0400] "GET /sitemap.xml HTTP/1.1" 404 153 "-" "-"
80.82.77.139 - - [02/Nov/2019:19:52:00 -0400] "GET /.well-known/security.txt HTTP/1.1" 404 153 "-" "-"
80.82.77.139 - - [02/Nov/2019:19:52:02 -0400] "GET /favicon.ico HTTP/1.1" 404 153 "-" "python-requests/2.13.0"