Nginx and apache service url problems

Source: Internet
Author: User
Problem Description 1. recently I am working on my own blog. The local wamp integration environment is lnmp online. The web framework uses thinkphp5.0.1. one module in the project is front, and the controller Article contains the index, lists, and show methods. 2. set routes in the tp framework, as shown below... problem description 1. recently I am working on my own blog. I am using the local wamp integration environment, and the online environment is lnmp. The web framework uses thinkphp5.0.1, and one module in the project is front, Controller Article, Respectively. index, lists, showMethod. 2. set routes in the tp framework as follows:
# Front post 'blog '=> ['front/Article/Index', [], [], 'A /: ID' => ['front/Article/Show', [], [], 'blogs' => ['front/Article/lists', [], [], 'blog/add' => ['front/Article/add', [], [], 'blog/edit /: ID' => ['front/Article/edit', [], [],
3. The index method is set to redirect to the lists method.
    public function index()    {        $this->redirect(Url::build('front/Article/lists', '', false));    }
4. specific error: local access Link 1 http://www.ibala.top/blogAnd Link 2 http://www.ibala.top/blog/The results are the same. Link 3 http://www.ibala.top/blogsWhen the project is migrated to the production environment, problems are discovered. Link 2But will jump Link 4 http://www.ibala.top/index.php/blogs5. The question is a bit messy. can my friends help me with my regret? Nginx configuration file
Server {listen 80; # listen [:]: 80; server_name ibala. top www. ibala. top; index index.html index.htm index. php; root/home/wwwroot/ibala. top/public; location/{if (! -E $ request_filename) {rewrite ^/(. *) $/index. php/$1 last; break ;}## php configuration, compatible with the thinkphp framework location ~. Php {set $ path_info ""; set $ real_script_name $ fastcgi_script_name; if ($ fastcgi_script_name ~ "^ (. +? \. Php )(/. +) $ ") {set $ real_script_name $1; set $ path_info $2;} fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index. php; SCRIPT_FILENAME $ document_root $ real_script_name; fastcgi_param SCRIPT_NAME $ real_script_name; fastcgi_param PATH_INFO $ path_info; fastcgi_param SERVER_PORT 80; include fastcgi_params;} location ~. * \. (Gif | jpg | jpeg | png | bmp | swf) $ {expires 30d;} location ~. * \. (Js | css )? $ {Expires 12 h;} location ~ /\. Ht {deny all ;}## prohibit direct access to sensitive files location ~ * \. (Inc | bak | SQL | lua | so | ini | conf) $ {deny all;} access_log/home/wwwlogs/ibala. top. log ;}

Reply content: Problem description 1. recently I am working on my own blog. I am using a local wamp integrated environment. online is lnmp. The web framework uses thinkphp5.0.1, and one module in the project is front, Controller Article, Respectively. index, lists, showMethod. 2. set routes in the tp framework as follows:
# Front post 'blog '=> ['front/Article/Index', [], [], 'A /: ID' => ['front/Article/Show', [], [], 'blogs' => ['front/Article/lists', [], [], 'blog/add' => ['front/Article/add', [], [], 'blog/edit /: ID' => ['front/Article/edit', [], [],
3. The index method is set to redirect to the lists method.
    public function index()    {        $this->redirect(Url::build('front/Article/lists', '', false));    }
4. specific error: local access Link 1 http://www.ibala.top/blogAnd Link 2 http://www.ibala.top/blog/The results are the same. Link 3 http://www.ibala.top/blogsWhen the project is migrated to the production environment, problems are discovered. Link 2But will jump Link 4 http://www.ibala.top/index.php/blogs5. The question is a bit messy. can my friends help me with my regret? Nginx configuration file
Server {listen 80; # listen [:]: 80; server_name ibala. top www. ibala. top; index index.html index.htm index. php; root/home/wwwroot/ibala. top/public; location/{if (! -E $ request_filename) {rewrite ^/(. *) $/index. php/$1 last; break ;}## php configuration, compatible with the thinkphp framework location ~. Php {set $ path_info ""; set $ real_script_name $ fastcgi_script_name; if ($ fastcgi_script_name ~ "^ (. +? \. Php )(/. +) $ ") {set $ real_script_name $1; set $ path_info $2;} fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index. php; SCRIPT_FILENAME $ document_root $ real_script_name; fastcgi_param SCRIPT_NAME $ real_script_name; fastcgi_param PATH_INFO $ path_info; fastcgi_param SERVER_PORT 80; include fastcgi_params;} location ~. * \. (Gif | jpg | jpeg | png | bmp | swf) $ {expires 30d;} location ~. * \. (Js | css )? $ {Expires 12 h;} location ~ /\. Ht {deny all ;}## prohibit direct access to sensitive files location ~ * \. (Inc | bak | SQL | lua | so | ini | conf) $ {deny all;} access_log/home/wwwlogs/ibala. top. log ;}

Can refer to this: http://www.jb51.net/article/8...
Uncertain availability

It is estimated that it is a problem with nginx configuration. here is a configuration:
Location /{
If (! -E $ request_filename ){
Rewrite ^ (. *) $/index. php? S = $1 last;
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.