Recently I changed Apache to nginx. When I moved the TP project to run, I found a 404 error. It turned out that this was because nginx did not support pathinfo mode and needed to be configured by myself. Below I configure In the server configuration location / { #root html index index.html index.htm index.php ; if (!-e $request_filename) { rewrite ^/test/tp/(.*)$ /test/tp/index.php/$1 last; break; } location ~ \.php { #Note that this must be the same, no $ set $script $uri; set $path_info "/"; if ($uri ~ "^(.+\.php)(/.+)") { set $script $1; set $path_info $2; } fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php?IF_REWRITE=1; include fastcgi_params; fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $document_root/$script; fastcgi_param SCRIPT_NAME $script; } After saving the configuration, restart nginx and the configuration is successful Directly supports pseudo-static mode like /Index.html The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Front-end state management (Part 2)
>>: HTML table markup tutorial (18): table header
Preface Recently, my computer often takes a long ...
On web pages, we often encounter this situation: ...
Table of contents Overview Vuex four major object...
This article example shares the specific code for...
Preface MySQL is a relational database with stron...
Use Code Cloud to build a Git code storage wareho...
Why do I want to organize the content in this area...
This article shares the specific code of JavaScri...
Preface A few days ago, I came across the feature...
Arrow function is a new feature in ES6. It does n...
This is to commemorate the 4 pitfalls I stepped o...
1. Use of Iframe tag <br />When it comes to ...
1. Resume nacos database Database name nacos_conf...
html <!DOCTYPE html> <html lang="en...
Preface All hardware devices in the Linux system ...