nginx rewrite url 重写

来源:互联网 发布:unity3d计算机图形学 编辑:程序博客网 时间:2024/05/22 15:16

vhosts.conf配置文件或相关的端口所在的配置文件,

在server中修改如下即可:


server {
    listen       8002;
    server_name  Admin_Api;
    server_name  localhost;
    root         /data/www/PG_Backend_API/public/;

    location / {
        try_files  $uri $uri/ /index.php?$query_string;
        index      index.php;
    }


    location ~ ^/.+\.php {
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME $request_filename;
        fastcgi_param  PATH_INFO $fastcgi_path_info;
        fastcgi_param  PATH_TRANSLATED $document_root$fastcgi_path_info;
        include        fastcgi_params;
        fastcgi_pass   127.0.0.1:9000;
    }
}


so easy!

 

原创粉丝点击