博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
windows下面配合thinkphp5.1.7的nginx.conf内容
阅读量:6913 次
发布时间:2019-06-27

本文共 2390 字,大约阅读时间需要 7 分钟。

参考了https://blog.csdn.net/yangjiale521/article/details/77623514 感谢该作者

#user nobody;
worker_processes 1;

#error_log logs/error.log;

#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '

# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

sendfile on;

#tcp_nopush on;

#keepalive_timeout 0;

keepalive_timeout 65;

#gzip on;

server {

listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

set $root D:/PHPEnvironment/wwwroot/zdhc/public;

location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
{
root $root;
}
root $root;

index index.php index.html index.htm;

location @rewrite {

rewrite ^(.*)$ index.php/$1 last;
}

location / {

if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html

#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80

#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#
location ~ \.php {
root $root;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name;
include fastcgi_params;
}

# deny access to .htaccess files, if Apache's document root

# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {

# root html;
# index index.html index.htm;
# }
#}

# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
#
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
#
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
#
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
#
# location / {
# root "D:/PHPEnvironment/wwwroot";
# index index.html index.htm index.php;
# }
#}

}

转载于:https://www.cnblogs.com/fyydcxy/p/9261785.html

你可能感兴趣的文章
['1','2','3'].map(parseInt)的返回值是什么?
查看>>
引入iconfont图标-微信小程序
查看>>
权限(适用于初学者)
查看>>
startService过程
查看>>
内容创业转舵
查看>>
leetcode 120 三角形最小路径和
查看>>
圣杯布局进阶版-flex布局实现
查看>>
《速度与激情》范迪塞尔代言!雅迪和高端“死磕”到底
查看>>
LLDB 知多少
查看>>
淘宝、网易移动端 px 转换 rem 原理,Vue-cli 实现 px 转换 rem
查看>>
js监听gif停止 libgif-js Gif 操作(开始,暂停,移动帧...) 功能强大
查看>>
java并发编程 • 核心 • 状态管理
查看>>
[译] 从没有人告诉过我的 CSS 小知识
查看>>
这个乐趣,支付宝落地实践
查看>>
Golang 1.x版本泛型编程
查看>>
武汉区块链软件技术公司:区块链应用为何成为现实版的“海市蜃楼”
查看>>
关于制作pod时使用xib等资源文件的问题
查看>>
《代码大全》读书笔记-构建的前期
查看>>
混合云管理问题,你解决了么?
查看>>
从简单二叉树问题重新来看深度优先搜索
查看>>