server {
listen 80;
server_name zhou.tp.com;
set $root_path 'E:\Xteam\public';
root $root_path;
index index.php index.html index.htm;
#hide index.php
location / {
# yii2 框架的 /site/index?name=sallency&age=25 模式的 rewrite 方法
#try_files $uri $uri/ /index.php$is_args$args;
# tp 框架的 /site/index/name/sallency/age/25 模式的 rewrite 方法
#try_files $uri $uri/ /index.php/$uri;
# 虽然 if 不规范但 rewrite 还是很方便的 可以兼容 yii2 和 tp 的 pathinfo 模式
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
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;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
server_name zh.tp.com;
set $root_path 'E:\zhou\public';
root $root_path;
index index.php index.html index.htm;
#hide index.php
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
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;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
server_name i.lov.me;
set $root_path 'E:\shuai\public';
root $root_path;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
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;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
}
location ~ /\.(?!well-known).* {
deny all;
}
}
TP5和Laravel5.7 Nginx配置
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...