I am trying to run Nextcloud,a Homepage and Paperwork under different locations, but can't figure out how to configure my nginx-config correctly.
My working tree looks like this:
/var/www/
|-> website
|-> nextcloud
|-> paperwork
My Homepage is reachable through web.domain.com and my Nextcloud ist reachable with cloud.domain.com. Now i want to get Paperwork to be reachable under web.domain.com/notes. The index.php of Paperwork lies in the subfolder "paperwork/frontend/public".
This is my attemp to solve this (without the whole ssl and the cloud part):
server{
listen 443 ssl http2;
server_name web.domain.com;
error_log /var/log/nginx/debug.log debug;
root /var/www/website;
location / {
index index.php index.html;
}
location /notes {
alias /var/www/paperwork/frontend/public;
index index.php index.html index.htm;
try_files $uri $uri/index.php;
}
location ~ /(nextcloud|backups) {
deny all;
return 403;
}
location ^~ /nextcloud/ {
deny all;
return 402;
}
location ^~ /nextcloud/ {
deny all;
return 402;
}
location ~ \.php$ {
try_files $uri =404;
alias /var/www/paperwork/frontend/public;
index index.php index.html index.htm;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}
}
I tried out a lot different solutions but i eather get an 404 because he is using the wrong directory and can't find /var/www/notes/index.php (or similar errors) or nginx is returning me just the index.php as a file-download.
Thx in advance!