Last active
January 2, 2016 15:09
-
-
Save haithembelhaj/8322005 to your computer and use it in GitHub Desktop.
Default ngnix conf for php
This file contains 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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
access_log /var/log/nginx/findBeauty_access.log; | |
error_log /var/log/nginx/findBeauty_error.log info; | |
client_max_body_size 10M; | |
root /var/www/app/public; | |
index index.html index.php; | |
# Make site accessible from http://localhost/ | |
server_name findbeauty.dev; | |
location @rules { | |
rewrite ^/(.*)$ /index.php?$1 last; | |
} | |
location / { | |
index index.php; | |
try_files $uri @rules; | |
} | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
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