Skip to content

Instantly share code, notes, and snippets.

@hissy
Created February 11, 2025 11:36
Show Gist options
  • Save hissy/0fb2f801981da9d86e7a240d13648203 to your computer and use it in GitHub Desktop.
Save hissy/0fb2f801981da9d86e7a240d13648203 to your computer and use it in GitHub Desktop.
[Concrete CMS] nginx conf to run Concrete CMS on subdirectory
location ^~ /sub {
## Try to find a file with given URL, if not pass to Concrete
try_files $uri $uri/ /sub/index.php?$query_string;
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_split_path_info ^(/sub)(/.*)$;
fastcgi_param SCRIPT_NAME /sub/index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root/sub/index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass ${NGINX_FASTCGI_PASS:-php}:9000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment