Last active
August 29, 2015 14:00
-
-
Save jovib/11262856 to your computer and use it in GitHub Desktop.
Simple Laravel Nginx Configuration
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
| worker_processes 1; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| include mime.types; | |
| default_type application/octet-stream; | |
| sendfile on; | |
| keepalive_timeout 65; | |
| # For LARAVEL FRAMEWORK | |
| server { | |
| listen 80; | |
| server_name localhost; | |
| location / { | |
| root html/<application-name>/public; | |
| index index.php index.html index.htm; | |
| try_files $uri $uri/ /index.php; # OR ---> try_files $uri $uri/ /index.php?q=$uri&$args; | |
| } | |
| error_page 500 502 503 504 /50x.html; | |
| location = /50x.html { | |
| root html; | |
| } | |
| location ~ \.php$ { | |
| root html/<application-name>/public; | |
| fastcgi_pass 127.0.0.1:9000; | |
| fastcgi_index index.php; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| include fastcgi_params; | |
| } | |
| } | |
| # working with OCTOBER CMS | |
| server { | |
| listen 83; | |
| server_name localhost; | |
| location / { | |
| root www/<APP-NAME>; | |
| index index.php index.html index.htm; | |
| try_files $uri $uri/ /index.php; | |
| } | |
| error_page 500 502 503 504 /50x.html; | |
| location = /50x.html { | |
| root www; | |
| } | |
| location ~ \.php$ { | |
| root www/<APP-NAME>; | |
| fastcgi_pass 127.0.0.1:9000; | |
| fastcgi_index *.php; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name; | |
| fastcgi_param PATH_INFO $fastcgi_path_info; | |
| fastcgi_split_path_info ^(.+\.php)(.*)$; | |
| include fastcgi_params; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment