linux nginx配置新项目加域名
server{ listen80; server_name beibeigou8.com;
index index.html index.htm index.php;
#root
/home/wwwroot/weilang;#if (!-e $request_filename) { # rewrite
^/(.*)$/index.php/$1last; #
break; #}
#error_page
404 /404.html; #include enable
-php.conf; rewrite
^/$ http://www.beibeigou8.com/ permanent;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
#location ~ ^(.+\.php)(.*)$ {
location ~ .php {
root /home/wwwroot/weilang;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
access_log/home/wwwlogs/access.logaccess;
}
页:
[1]