nginx重写规则不能用?
程序员文章站
2022-04-28 20:13:16
...
回复内容:
server {
listen 80; # IPv4
server_name *****.com;
## Parametrization using hostname of access and log filenames.
access_log logs/localhost_access.log;
error_log logs/localhost_error.log;
## Root and index files.
root html/yimifa;
index index.php index.html index.htm;
## If no favicon exists return a 204 (no content error).
location = /favicon.ico {
try_files $uri =204;
log_not_found off;
access_log off;
}
## Don't log robots.txt requests.
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
## Try the requested URI as files before handling it to PHP.
location / {
## Regular PHP processing.
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass php_processes;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
## Static files
location ~* \.(?:css|gif|htc|ico|js|jpe?g|png|swf)$ {
expires max;
log_not_found off;
## No need to bleed constant updates. Send the all shebang in one
## fell swoop.
tcp_nodelay off;
## Set the OS file cache.
open_file_cache max=1000 inactive=120s;
open_file_cache_valid 45s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
}
## Keep a tab on the 'big' static files.
location ~* ^.+\.(?:ogg|pdf|pptx?)$ {
expires 30d;
## No need to bleed constant updates. Send the all shebang in one
## fell swoop.
tcp_nodelay off;
}
} # / location
}
这是nginx.conf里头的配置,难道有影响?
推荐阅读
-
WordPress与Drupal的Nginx配置rewrite重写规则示例
-
WordPress中开启多站点支持及Nginx的重写规则配置
-
nginx rewrite重写规则与防盗链配置方法教程详解
-
解析CI即CodeIgniter框架在Nginx下的重写规则
-
Laravel的Nginx重写规则实例代码
-
nginx负载均衡(5种方式)、rewrite重写规则及多server反代配置梳理
-
详解常用的nginx rewrite重写规则
-
解析CI即CodeIgniter框架在Nginx下的重写规则
-
nginx+apache跑CI框架,url重写规则如何写
-
解析CI即CodeIgniter框架在Nginx下的重写规则_PHP教程