当前位置:首页>开发>正文

nginx伪静态怎么写 nginx 伪静规则谁有哇

2023-07-06 01:00:21 互联网 未知 开发

 nginx伪静态怎么写 nginx 伪静规则谁有哇

nginx伪静态怎么写

location / {
rewrite ^([^.]*)/go/?i=([0-9] )$ $1/go/$2 last
rewrite ^([^.]*)/go/index.php?i=([0-9] )$ $1/go/$2 last #为了完善一点
if (!-e $request_filename) { return 404 }
}

nginx 伪静规则谁有哇

RewriteEngine On RewriteBase / RewriteRule ^item/([0-9a-z] ).html$ /goods.php?iid=$1改成Nginx下伪静态规则rewrite ^/item/([0-9a-z] ).html$ /goods.php?iid=$1 last放到location / {}里面

thinkphp 伪静态 nginx 规则怎么设置

关于nginx的伪静态设置(案例)
server {
listen 80
server_name localhost
index index.html index.htm index.php
root /alidata/www/
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?s=/$1 last
}
}
location ~ .*.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock
fastcgi_pass 127.0.0.1:9000
fastcgi_index index.php
include fastcgi.conf
# 以下是为了让Nginx支持PATH_INFO
set $path_info ""
set $real_script_name $fastcgi_script_name
if ($fastcgi_script_name ~ "^(. ?.php)(/. )$") {
set $real_script_name $1
set $path_info $2
}
fastcgi_param script_FILENAME $document_root$real_script_name
fastcgi_param script_NAME $real_script_name
fastcgi_param PATH_INFO $path_info
fastcgi_connect_timeout 120
fastcgi_send_timeout 120
fastcgi_read_timeout 120
fastcgi_buffers 8 128K
fastcgi_buffer_size 128K
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d
}
location ~ .*.(js|css)?$
{
expires 1h
}
#伪静态规则
access_log /alidata/log/nginx/access/default.log
}

随便看看