nginx重写404错误

时间:2012-12-13 08:27:54

标签: nginx seo rewrite

它应该如何运作

  1. 前端开始页面为http://server/apex/ - 死页
  2. 重定向到工作页面to /apex/f?p=100:4:0::NO:::
  3. 制作干净的网址类型http://server/apex/4/0/NO
  4. location / {

       proxy_pass http://127.0.0.1:8080;
        include /etc/nginx/reverse_proxy.conf;
        rewrite ^/$ /apex/f?p=100:4:0::NO:::? permanent;
           }
    
    location  /apex {
        proxy_pass http://127.0.0.1:8080;
        include /etc/nginx/reverse_proxy.conf;
    
        if ($args ~ "p=100:(.*):(.*)::(.*):::") {
                      set $args $1/$2/$3/$4;
                      rewrite ^/[a-z]+/.+ /apex/$args?;
                                  }
            }
    

    proxy_pass http://127.0.0.1:8080; include /etc/nginx/reverse_proxy.conf; rewrite ^/$ /apex/f?p=100:4:0::NO:::? permanent; } location /apex { proxy_pass http://127.0.0.1:8080; include /etc/nginx/reverse_proxy.conf; if ($args ~ "p=100:(.*):(.*)::(.*):::") { set $args $1/$2/$3/$4; rewrite ^/[a-z]+/.+ /apex/$args?; } }

    从nginx登录 - access.log “

    来自错误日志(调试)

    GET / HTTP/1.1" 301 178 "-"
    "GET /apex/f?p=100:4:0::NO::: HTTP/1.1" 404 5 
    

    我做错了什么?

0 个答案:

没有答案