kissshop 发表于 2013-5-13 12:28:58

NGINX服务器伪静态规则添加后不起作用

你好,

根据官方提供的伪静态规则,添加后,在后台开启了伪静态,打开网站显示404错误。

PS:在使用淘宝客免费版时,添加了伪静态规则,后而成功了。使用VIP版反而不起作用!!求解决方法及大神指点!

添加代码如下:<p>userwww www;</p><p>worker_processes 1;</p><p>error_log/home/wwwlogs/nginx_error.logcrit;</p><p>pid      /usr/local/nginx/logs/nginx.pid;</p><p>#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;</p><p>events
{
use epoll;
worker_connections 51200;
}</p><p>http
{
include       mime.types;
default_typeapplication/octet-stream;</p><p>server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;</p><p>sendfile on;
tcp_nopush   on;</p><p>keepalive_timeout 60;</p><p>tcp_nodelay on;</p><p>fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;</p><p>gzip on;
gzip_min_length1k;
gzip_buffers   4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types       text/plain application/x-javascript text/css application/xml;
gzip_vary on;</p><p>#limit_zonecrawler$binary_remote_addr10m;</p><p>#log format
log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';</p><p>server
{
listen       8080;
server_name 122.228.64.64;
index index.html index.htm index.php;
root/home/wwwroot;</p><p>location ~ .*\.(php|php5)?$
   {
    try_files $uri =404;
    fastcgi_passunix:/tmp/php-cgi.sock;
    fastcgi_index index.php;
    include fcgi.conf;
   }</p><p>
location /
{
rewrite ^(.*)list/(+)(-s-())?(-p-())?(-(+))?\.html$ $1list.php?catid=$2&sort=$4&price=$6&page=$8 last;
rewrite ^(.*)item/(+)\.html$ $1item.php?id=$2 last;
rewrite ^(.*)search/(+)(-c-(+))?(-s-())?(-p-())?-?(+)?\.html$ $1search.php?kw=$2&catid=$4&sort=$6&price=$8&page=$9 last;
rewrite ^(.*)shop/(+)(-c(+))?(-(+))?\.html$ $1shop.php?nick=$2&catid=$4&page=$6 last;
location ~ ^.*/photo/+\.jpg$ {
   rewrite ^(.*)photo/(+)\.jpg$ $1photo.php?u=$2 last;
}
}</p><p>      
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
   {
    expires      30d;
   }</p><p>location ~ .*\.(js|css)?$
   {
    expires      12h;
   }</p><p>access_log/home/wwwlogs/access.logaccess;
}
include vhost/*.conf;
}</p><p>

</p><p> </p>

admin 发表于 2013-5-13 13:58:18

免费版F系列的伪静态规则和VIP版的完全一样,免费版可以的话VIP版也可以。用程序包里带的伪静态规则即可,规则很多用户都在用没什么问题,如果不行需要空间上找原因,查查是不是伪静态没配置好或其它的冲突之类的
页: [1]
查看完整版本: NGINX服务器伪静态规则添加后不起作用