Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set the pseudo-static of php in nginx

Shulou Source: shulou.com Published: 2022-06-03 12:22:47 11月15日 Update

This article is about how to set the pseudo-static of php in nginx. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Nginx php pseudo-static setting method: 1, execute "include vhost/*.config"; 2, copy the content at the beginning of "server {listen 80 quartername think6.cn...}" and modify it.

This article operating environment: linux5.9.8 system, PHP7.1 version, Dell G3 computer

Php nginx pseudo-static configuration

Location / {if (!-e $request_filename) {rewrite ^ / index.php (. *) $/ index.php?s=/$1 last; rewrite ^ (. *) $/ index.php?s=/$1 last; break;}}

To make the configuration file clear.

Nginx can be extracted by introducing files.

Include vhost/*.config

Copy the content started by server {} and modify it.

Server {listen 80; server_name think6.cn; root ""; / / location / {index index.php index.html error/index.html; error_page 400 / error/400.html; include EVOGRAPHUA } location ~\ .php (. *) ${fastcgi_pass 127.0.0.1 fastcgi_index index.php; fastcgi_split_path_info 9006; fastcgi_index index.php; fastcgi_split_path_info ^ ((? U). +\ .php) (/?. +) $; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info Fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params;} access_log / www/wwwlogs/enl.bepemo.com.log;// receive log error_log / www/wwwlogs/enl.bepemo.com.error.log;// error log} Thank you for reading! This is the end of the article on "how to set the pseudo-static state of php in nginx". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Static content files logs more articles configuration good practical can be passed articles methods understanding environment computer see knowledge system errors reference Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Docker macOS NVidia Apple