Git Product home page Git Product logo

Comments (6)

 avatar commented on August 20, 2024

自己弄好了,花了半天做了一套Nginx配置文件。现在正常了

from dreamcat.

P3R5T7U9 avatar P3R5T7U9 commented on August 20, 2024

自己弄好了,花了半天做了一套Nginx配置文件。现在正常了

抱歉打扰了,近期正想搭建个人博客,为选择哪款主题在github 上翻找半天,偶然翻到这个主题仓库,看了下实例截图,感觉还不错,决定安装这款主题,但随之也遇到老哥你前几天开的这条issue反馈的问题,看老哥你最后回复说花半天做了配套的Nginx文件,麻烦老哥分享下自制的Nginx配置文件么??
(小声:目前处于学习Nginx初级阶段,尚未达到制作完整的配置文件水平,这不看到老哥你你开的这条issue后,想着趁老哥你之后如能分享对DreamCatV3 主题配套的Nginx配置文件,也学习下Nginx进阶姿势)

from dreamcat.

 avatar commented on August 20, 2024

就是套通用的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.

 avatar commented on August 20, 2024

启动命令nginx -c <nginx.conf绝对路径 >
停止命令nginx -c <nginx.conf绝对路径 >
本人也是个nginx新手,见谅

from dreamcat.

 avatar commented on August 20, 2024

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.

 avatar commented on August 20, 2024

送你一个知乎大佬写的配置优化教程,我认为写的还不错。网盘里我发的那个我加上了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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.