Nginx学习总结【第二篇】: Nginx部署及使用
Nginx部署及使用
$ cat nginx.conf worker_processes 8; error_log logs/error.log; error_log logs/error.log notice; error_log logs/error.log info; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name xxxx; root /data0/www; index index.html index.htm index.php; location / { if (!-e $request_filename) { rewrite ^/topic/(.*)$ /topic/index.php/$1; } } location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/tmp/php-cgi.sock; } # ThinkPHP pathinfo * URL Rewrite location ~ ^(.+\.php)(.*)$ { include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/tmp/php-cgi.sock; } location ~ /\.(ht|svn|git) { deny all; } } }
出处:http://www.cnblogs.com/madsnotes/
声明:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。
浙公网安备 33010602011771号