server {
listen 80;
server_name www.xxxx.cn xxxx.cn; #填你:第2步dns解析,配置的虚拟域名
root "/data/xxxx/xxxx"; #填你:网站所在目录
location / {
index index.html index.htm index.php;
autoindex on;
# 伪静态配置
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
fastcgi_param TP_ENV sixian;
}
}
nginx手机端跳转
if ($http_user_agent ~* (mobile|nokia|iphone|ipad|android|samsung|htc|blackberry)) {
rewrite ^/(.*)$ http://m.bangbangji.com/$1 permanent;
}
Apache301跳转
RewriteRule ^(.*)$ http://www.lituanmin.com/$1 [L,R=301]
压缩服务器上当前目录的内容为xxx.zip文件
zip -r xxx.zip ./*
解压zip文件到当前目录
unzip filename.zip
nginx 重启
cd /usr/local/nginx/sbin
./nginx -s reload
df -h / 根目录内存