Contoh konfigurasi nginx laravel

Percobaan kali ini akan experimen setup nginx webserver untuk salah satu php framework laravel. dengan setup dibawah ini pada /etc/nginx/sites-available/nama_config_masing_masing.conf

server {
listen 8080 default_server;
listen [::]:8080 default_server ipv6only=on;

root /home/hendar/Public/project/laravel/public;
index index.php index.html index.htm;


location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules


# pass the PHP scripts to FastCGI server listening on
location ~ .php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

# With php5-cgi alone:

# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;


comments powered by Disqus