I've been trying to put Flarum on a sub-directory with Laravel being on the root directory. I've tried a number of things and the only response that I get from the server is either a 404, or the laravel index.php downloaded (when I visit /forum).
From what I can remember, I have tried:
- Having an individual
location ~\.phpfor every subdirectory. - Putting the php location in the sub-directory location.
- Trying both root and alias in the location.
My setup is as follows:
- Laravel files on /var/www/laravel/public/
- Flarum files on /var/www/forum/
- PHP5-FPM on /var/run/php5-fpm.sock
Laravel is been working through the whole process, but I can't manage to get flarum to work.
server { listen 80; server_name website.web return 301 https://website.web$request_uri; } server { listen 443 ssl; server_name website.web access_log /var/www/logs/access.log; error_log /var/www/logs/error.log warn; ssl_certificate /var/www/ssl/website.chained.crt; ssl_certificate_key /var/www/ssl/website.key; root /var/www/laravel/public/; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location /forum/ { root /var/www/; try_files $uri $uri/ /index.php?$query_string; } location /forum/admin/ { root /var/www/; try_files $uri $uri/ /admin.php?$query_string; } location /forum/api/ { root /var/www/; try_files $uri $uri/ /api.php?$query_string; } location /flarum { deny all; return 404; } location ~ \.php$ { try_files $uri /index.php =404; fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } If the config wont work for some reason, then here's a pastebin link with it.