Skip to content

Instantly share code, notes, and snippets.

@sseidenthal
Created September 7, 2016 15:02
Show Gist options
  • Save sseidenthal/1506b7736cd1880862923ee12c07abe3 to your computer and use it in GitHub Desktop.
Save sseidenthal/1506b7736cd1880862923ee12c07abe3 to your computer and use it in GitHub Desktop.
NGINX, Symfony 2 with SimpleSamlPhp as Alias
server {
server_name default;
root /var/www/symfony/web;
client_max_body_size 100M;
fastcgi_read_timeout 1800;
location / {
try_files $uri @rewriteapp;
}
location ^~ /simplesaml {
alias /var/www/simplesamlphp/www;
index index.php;
location ~ ^(?<prefix>/simplesaml)(?<phpfile>.+?\.php)(?<pathinfo>/.*)?$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$phpfile;
fastcgi_param PATH_INFO $pathinfo if_not_empty;
}
}
location @rewriteapp {
rewrite ^(.*)$ /app_dev.php$1 last;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
@sseidenthal
Copy link
Author

put your symfony code in: /var/www/symfony/
put simplesamlphp in: /var/www/simplesamlphp/

@alexbaron
Copy link

thank you it saves me my day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment