-
-
Save trungx/b2a2fef58ad2a15c3f1eaebc2f5c77c1 to your computer and use it in GitHub Desktop.
Nginx server config for Laravel 4 and SimpleSamlphp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Nginx host conf | |
| # | |
| # Allows Laravel 4 and SimpleSamlphp to exist together peacefully | |
| # | |
| # Laravel 4 - | |
| # https://github.com/laravel/laravel | |
| # SimpleSamlphp - | |
| # https://github.com/simplesamlphp/simplesamlphp | |
| # | |
| server { | |
| listen 80; | |
| listen [::]:80 ipv6only=on; | |
| # listen 443 ssl; | |
| server_name your.domain.name; | |
| # ssl info | |
| # ssl_certificate /etc/nginx/ssl/your.domain.name.crt; | |
| # ssl_certificate_key /etc/nginx/ssl/your.domain.name.key; | |
| # site root path | |
| root /var/www/public; | |
| # simple saml config block | |
| location /simplesaml { | |
| # add alias root to global simple saml install (default location) | |
| alias /var/simplesamlphp/www; | |
| # set index document | |
| index index.php; | |
| # simple saml php-fpm config | |
| # based on: http://casadelkrogh.dk/code/2014/09/30/embedding-simplesamlphp-using-nginx/ | |
| location ~ \.php(/|$) { | |
| fastcgi_split_path_info ^(.+?\.php)(/.+)$; | |
| fastcgi_param PATH_INFO $fastcgi_path_info; | |
| fastcgi_pass unix:/var/run/php5-fpm.sock; | |
| fastcgi_index index.php; | |
| include fastcgi_params; | |
| } | |
| } | |
| # laravel url config | |
| location / { | |
| index index.php; | |
| try_files $uri $uri/ /index.php?q=$uri&$args; | |
| } | |
| # laravel php config | |
| # based on : http://laravel-recipes.com/recipes/26/creating-a-nginx-virtualhost | |
| location ~ \.php$ { | |
| fastcgi_split_path_info ^(.+?\.php)(/.+)$; | |
| fastcgi_param PATH_INFO $fastcgi_path_info; | |
| fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| fastcgi_pass unix:/var/run/php5-fpm.sock; | |
| fastcgi_index index.php; | |
| include fastcgi_params; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment