Created
October 20, 2012 22:53
-
-
Save elchappo/3925117 to your computer and use it in GitHub Desktop.
PHP nginx configration
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; | |
server_name <domine>; | |
access_log /var/log/<domine>.access_log; | |
error_log /var/log/<domine>.error_log; | |
root <domine_path>; | |
location ~ ^/resize/([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ { | |
try_files $uri @resize; | |
expires 4h; | |
} | |
location / { | |
expires 4h; | |
} | |
location ~ \.php(.*)$ { | |
try_files $uri = 404; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_index index.php; | |
include /usr/local/nginx/conf/fastcgi_params; | |
} | |
location @resize { | |
rewrite ^/resize/([0-9]+)/([0-9]+)/([0-9]+)/(.*)? /resize.php?width=$1&hight=$2&mode=$3&path=$4; | |
include /usr/local/nginx/conf/fastcgi_params; | |
fastcgi_pass 127.0.0.1:8000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment