-
Notifications
You must be signed in to change notification settings - Fork 627
Closed
Description
According to #1005 and #1610 FreeScout supports subdirectory installation (e.g. https://example.com/freescout/ instead of https://freescout.example.com), however if I use the nginx config from the Installation Guide I cannot get nginx to serve static files without breaking FreeScout's routing.
Here's my current nginx config:
server {
...
root /var/www/freescout/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
...and here's what it gets me:


This is what I've tried:
server {
...
root /var/www/freescout/public;
index index.php index.html;
location /freescout {
alias /var/www/freescout/public;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}
It fixes static files but breaks the routing:


Interestingly, in this case (if I clear the cookies) /freescout/login/ works correctly:

(The APP_URL parameter in the .env file is set correctly).
I'm thinking I need a rewrite somewhere, but I wonder what is the recommended way of solving this? Any tips would be appreciated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels