V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
guoyu4126
V2EX  ›  程序员

windows 下 nginx 伪静态配置

  •  
  •   guoyu4126 · 2018-07-12 12:20:07 +08:00 · 1728 次点击
    这是一个创建于 2106 天前的主题,其中的信息可能已经有所发展或是发生改变。
    server {
    listen 80;
    server_name localhost;
    index index.php index.htm index.html;
    set $webrootdir "F:/wnmp/www";

    #access_log F:/wnmp/nginx/logs/access.log main;
    #error_log F:/wnmp/nginx/logs/error.log info;


    #处理链接中不带 index.php 的情况
    if ($query_string ~* "pf=m(.*)$") {
    rewrite ^/ /index.php last;
    }

    root $webrootdir;


    location ~ \.php$ {
    include fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php ;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    #rewrite ^/goods-([0-9]+).html?$ /index.php?app=goods&id=$1 last;

    location /{
    rewrite ^/goods-([0-9]+).html?$ /index.php?app=goods&id=$1 last;
    }

    }



    搞不定了。 伪静态不生效。。
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5943 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 02:29 · PVG 10:29 · LAX 19:29 · JFK 22:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.