Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the pseudo-static of php in nginx

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report