Blogger Information
Blog 39
fans 1
comment 0
visits 62274
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
TP5 做为接口传递数据配置路径
Dai的博客
Original
2036 people have browsed it

使用TP5做为项目后台接口,在二级目录下配置nginx


1、首先,你要确保在不配置二级目录的情况下,可以通过浏览器访问到。例如:http://www.example.com/End/public/index.php?s=index/index/index

2、将下面一location 进行二级目录增加修改

server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html/member/;
        index index.html index.php
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
          if (!-e $request_filename) {
          rewrite  ^(.*)$  /index.php?s=$1  last;
          break;
         }
        }
        ####这里进行修改
        location /End/public/{
          index index.php index.html index.htm;
          if (!-e $request_filename){
                rewrite ^/End/public/(.*)$ /End/public/index.php?s=$1 last;
         }
        }
        #######
        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
         location ~ \.php$ {
                try_files $uri =404;

                 include fastcgi.conf;
                fastcgi_pass 127.0.0.1:9000;
            }
    }


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post