Skip to content

Instantly share code, notes, and snippets.

@bearlikelion
Created June 3, 2014 15:32
Show Gist options
  • Save bearlikelion/b94cfce647c2c9eec7a6 to your computer and use it in GitHub Desktop.
Save bearlikelion/b94cfce647c2c9eec7a6 to your computer and use it in GitHub Desktop.
nginx.conf
server {
listen *:80;
server_name mark.dev;
root /home/mark/dev/src/public;
index index.php;
location / {
# rewrite URL to remove trailing forward slash /
rewrite ^/(.*)/$ /$1 permanent;
try_files $uri /index.php?$query_string;
}
location /phpmyadmin {
root /usr/share/;
index index.php;
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name;
}
}
# HHVM
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# PHP-FPM
# location ~ \.php$ {
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param ENVIRONMENT DEVELOPMENT;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# include fastcgi_params;
# }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment