Comments (6)
自己弄好了,花了半天做了一套Nginx配置文件。现在正常了
from dreamcat.
自己弄好了,花了半天做了一套Nginx配置文件。现在正常了
抱歉打扰了,近期正想搭建个人博客,为选择哪款主题在github 上翻找半天,偶然翻到这个主题仓库,看了下实例截图,感觉还不错,决定安装这款主题,但随之也遇到老哥你前几天开的这条issue反馈的问题,看老哥你最后回复说花半天做了配套的Nginx文件,麻烦老哥分享下自制的Nginx配置文件么??
(小声:目前处于学习Nginx初级阶段,尚未达到制作完整的配置文件水平,这不看到老哥你你开的这条issue后,想着趁老哥你之后如能分享对DreamCatV3 主题配套的Nginx配置文件,也学习下Nginx进阶姿势)
from dreamcat.
就是套通用的php配置,需要php-fpm和nginx,自己搭建下就行。实际上不比宝塔面版更便捷。不过我手机没root安装不了宝塔,也没云服务器。这个配置不在默认目录/etc/nginx,因为我需要用mt管理器编辑网站。
https://pan.95bl.com/s/oBWSy
自己改一下里面的路径就行。
root /sdcard/nginx/htdocs;改成typecho网站根目录
fastcgi_pass unix:/data/data/com.termux/files/usr/var/run/php-fpm.sock;
把unix后面改成你服务器的php-fpm监听端口或者Socket都行
access_log和error_log路径随意。只要你能方便访问的位置就行
注意所有行后面不要丢英文半角分号。
listen改成网站端口,一般用80
from dreamcat.
启动命令nginx -c <nginx.conf绝对路径 >
停止命令nginx -c <nginx.conf绝对路径 >
本人也是个nginx新手,见谅
from dreamcat.
https支持:把nginx.conf下面https server注释下面的改成差不多这样就行了。还是一样,请自己改下文件路径
server {
listen 443 ssl;
#server_name localhost;
ssl_certificate /sdcard/nginx/typecho.certificate.crt;
ssl_certificate_key /sdcard/nginx/typecho.private.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
root /sdcard/nginx/htdocs;
index index.html index.htm index.php;
location ~ \.php?.*$ {
#try_files $uri =404;
fastcgi_pass unix:/data/data/com.termux/files/usr/var/run/php-fpm.sock;
#fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
from dreamcat.
送你一个知乎大佬写的配置优化教程,我认为写的还不错。网盘里我发的那个我加上了php,和MineType(不加上,CSS和JS有时会不加载),其他只是基础配置。
https://zhuanlan.zhihu.com/p/651514719
另外,如果部分网站源码要求强制伪静态/URL重写,不配置打不开的,nginx.conf中找到server段落,加上这个就行,还是别忘了如果缺少分号就加上分号,不过大括号后面不用加分号。
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
from dreamcat.
Related Issues (20)
- 建议:V3的表格样式不是很明显 HOT 3
- 建议:3.0版本主题左上角三个横杠的菜单能够固定在顶部,方便在任何页面范围点击展开 HOT 2
- 安装3.0主题后HTTPS安全检测降为B级 HOT 1
- Release中footer.php下的测试语句未删除
- php要求 HOT 2
- 功能建议:主题色/强调色的切换,以及夜间模式 HOT 3
- 功能建议:文章目录
- 问题反馈:DreamCat 3.x版本默认头像图片地址失效 HOT 1
- 问题反馈:时间栏的数字只有一位时没有加前置0 HOT 1
- 问题反馈:导航栏高度和图片无法更改 HOT 1
- 功能建议:将左边伸缩栏目移至个人介绍栏下方 HOT 1
- 功能建议:增设链接唤起手机app的功能,取代现在的社交平台二维码
- 建议:使用 Git LFS 存储库文件 HOT 4
- 3.0建议后台增加评论关闭 HOT 3
- 3.0修改独立页面背景图片不成功
- 增加备案号填空选项
- 建议:添加更出色的底栏自定义功能 HOT 2
- 增加代码行号显示 HOT 3
- 图片显示不全 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dreamcat.