Skip to content

Instantly share code, notes, and snippets.

@didats
Created May 26, 2016 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save didats/20960961526fc8a41cbaa5adb79b4169 to your computer and use it in GitHub Desktop.
Save didats/20960961526fc8a41cbaa5adb79b4169 to your computer and use it in GitHub Desktop.
Silex under subcategory with Nginx
location /your_subdirectory {
alias /var/www/html/your_subdirectory/web;
index index.php index.html;
if (-f $request_filename) {
break;
}
rewrite ^(.*)$ /your_subdirectory/index.php last;
}
location ~ /your_subdirectory/(.+)\.php(/|$) {
set $script $uri;
if ($uri ~ "/your_subdirectory/(.+\.php)(/|$)") {
set $script $1;
}
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/your_subdirectory/web/$script;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment