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

The setting of project nginx configuration file of TP framework in lnmp environment

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

The apache server used for development. TP framework.

Lnmp Server (lnmp.org):

The automatically generated configuration files after lnmp add are:

Server

{

Listen 80

# listen [::]: 80

Server_name -.

Index index.html index.htm index.php default.html default.htm default.php

Root/ home/wwwroot/----/public

Include none.conf; # error_page 404 / 404.html; include enable-php.conf; location ~. *\. (gif | jpg | jpeg | png | bmp | swf) ${expires 30d;} location ~. *\. (js | css)? ${expires 12h;} location ~ /\. {deny all;} access_log off;}

~

~

~

~

~

In that case,

Local,-/ admin can open

On the server-/ admin reported nginx's 404 error! 404 Not Found

Add the next few lines.

After modification, lnmp restart.

Just fine!

[root@hkdata02 vhost] # vi -. -. Conf

# listen [:]: 80; server_name--. -.--; index index.html index.htm index.php default.html default.htm default.php; root/ home/wwwroot/---/public; # include other.conf; # error_page 404 / 404.html; # Deny access to PHP files in specific directory # location ~ / (wp-content | wp-includes | images) /. *\ .php$ {deny all;} include enable-php.conf Location ~. *\. (gif | jpg | jpeg | png | swf) ${expires 30d;} location ~. *\. (js | css)? ${expires 12h;} location ~ / .well-known {allow all;} location ~ /\. {deny all;} if (!-e $request_filename) {rewrite ^ (. *) $/ index.php?s=$1 last; break;} access_log / home/wwwlogs/---.----.--.log;}

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

Servers

Wechat

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

12
Report