首页 » 话题 » 技术文章 » nginx 伪静态设置 rewrite

nginx 伪静态设置 rewrite

server
  {
    listen       80;
    server_name  www.xxx.com xxx.com;
    index index.htm index.html index.php;
    root  /opt/lvguo/www/home;
    error_page  404 /404.htm;

    include /opt/lvguo/www/home/.htaccess;
    location ~ .*\.(php|php5)?$
    {
      #fastcgi_pass  unix:/tmp/php-cgi.sock;
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_index index.php;
      include fcgi.conf;
      fastcgi_param SCRIPT_FILENAME  /opt/lvguo/www/home/$fastcgi_script_name;
      include fastcgi_params;

    }

    log_format  wwwlvguocomlogs  '$remote_addr - $remote_user [$time_local] "$request" '
               '$status $body_bytes_sent "$http_referer" '
               '"$http_user_agent" $http_x_forwarded_for';
    access_log  /usr/local/webserver/nginx/logs/wwwlvguocomlogs.log  wwwlvguocomlogs;
  }

.htaccess 内容

rewrite ^(.*)$ re.php;

  • 蜗牛 2015-04-20 17:19
    fwefewf


Copyright © imkoko.com 2002 - 2018 All Rights Reserved. imkoko 苏ICP备05045434号-3