Skip to content

Instantly share code, notes, and snippets.

@nntoan
Forked from bearlikelion/nginx.conf
Last active August 29, 2015 14:20
Show Gist options
  • Save nntoan/3db457f5a9fbbdd9aa85 to your computer and use it in GitHub Desktop.
Save nntoan/3db457f5a9fbbdd9aa85 to your computer and use it in GitHub Desktop.
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