V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
guoyu4126
V2EX  ›  程序员

windows 下 nginx 伪静态配置

  •  
  •   guoyu4126 · Jul 12, 2018 · 2085 views
    This topic created in 2856 days ago, the information mentioned may be changed or developed.
    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;
    }

    }



    搞不定了。 伪静态不生效。。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3480 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 11:37 · PVG 19:37 · LAX 04:37 · JFK 07:37
    ♥ Do have faith in what you're doing.