你好,
根据官方提供的伪静态规则,添加后,在后台开启了伪静态,打开网站显示404错误。
PS:在使用淘宝客免费版时,添加了伪静态规则,后而成功了。使用VIP版反而不起作用!!求解决方法及大神指点!
添加代码如下:- <p>user www www;</p><p>worker_processes 1;</p><p>error_log /home/wwwlogs/nginx_error.log crit;</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_type application/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_length 1k;
- 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_zone crawler $binary_remote_addr 10m;</p><p> #log format
- log_format access '$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_pass unix:/tmp/php-cgi.sock;
- fastcgi_index index.php;
- include fcgi.conf;
- }</p><p>
- location /
- {
- rewrite ^(.*)list/([0-9_/]+)(-s-([1-9]))?(-p-([1-9]))?(-([0-9]+))?\.html$ $1list.php?catid=$2&sort=$4&price=$6&page=$8 last;
- rewrite ^(.*)item/([0-9_/]+)\.html$ $1item.php?id=$2 last;
- rewrite ^(.*)search/([0-9A-Za-z]+)(-c-([0-9]+))?(-s-([1-9]))?(-p-([1-9]))?-?([0-9]+)?\.html$ $1search.php?kw=$2&catid=$4&sort=$6&price=$8&page=$9 last;
- rewrite ^(.*)shop/([0-9A-Za-z]+)(-c([0-9]+))?(-([0-9]+))?\.html$ $1shop.php?nick=$2&catid=$4&page=$6 last;
- location ~ ^.*/photo/[A-Za-z0-9]+\.jpg$ {
- rewrite ^(.*)photo/([A-Za-z0-9]+)\.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.log access;
- }
- include vhost/*.conf;
- }</p><p>
- </p><p> </p>
复制代码 |
|
|
|
|