VPS侦探论坛

 找回密码
 注册
查看: 2223|回复: 9

[Nginx] acg-faka lnmp. Nginx 伪静态,leveral

[复制链接]
发表于 2022-11-15 06:08:33 | 显示全部楼层 |阅读模式

https://github.com/lizhipay/acg-faka




把。Nginx伪静态规则 如下

location / {      if (!-e $request_filename){              rewrite ^(.*)$ /index.php?s=$1 last; break;      }}
添加到 /usr/local/nginx/conf/nginx.conf


卡在了

[backcolor=rgba(255, 255, 255, 0.3)]请先设置伪静态后在安装程序。



添加Vhost 时, 启用了 rewrite, 选择了 leveral


美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2022-11-15 10:53:52 | 显示全部楼层


https://lnmp.org/faq/lnmp-vhost-add-howto.html 官网有伪静态的使用教程
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2022-11-15 11:19:09 | 显示全部楼层

licess 发表于 2022-11-15 10:53
https://lnmp.org/faq/lnmp-vhost-add-howto.html 官网有伪静态的使用教程

谢谢, 回复。
看了官网了后,

location / {      if (!-e $request_filename){              rewrite ^(.*)$ /index.php?s=$1 last; break;      }}
添加到 /usr/local/nginx/conf/vhost/www.域名.com.conf

Starting nginx... nginx: [emerg] duplicate location "/" in /usr/local/nginx/conf/vhost/www.域名.com.conf:84
failed

补充内容 (2022-11-15 11:46):
sudo lnmp nginx restart
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2022-11-15 11:29:06 | 显示全部楼层



请问vhost 添加的对吗?


root@faka:~# lnmp vhost add
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Please enter domain(example: www.lnmp.org): www.yuming.org
Your domain: www.yuming.org
Enter more domain name(example: lnmp.org sub.lnmp.org):
domain list: www.yuming.org
Please enter the directory for the domain: www.yuming.org
Default directory: /home/wwwroot/www.yuming.org:
Virtual Host Directory: /home/wwwroot/www.yuming.org
Allow Rewrite rule? (y/n) y
Please enter the rewrite of programme,
wordpress,discuzx,typecho,thinkphp,laravel,codeigniter,yii2,zblog rewrite was exist.
(Default rewrite: other): laravel
You choose rewrite: laravel
Enable PHP Pathinfo? (y/n) y
Enable pathinfo.
Allow access log? (y/n) y
Enter access log filename(Default:www.yuming.org.log):
You access log filename: www.yuming.org.log
Enable IPv6? (y/n) y
Enabled IPv6 Support in current Virtualhost.
Create database and MySQL user with same name (y/n) n
Add SSL Certificate (y/n) y
1: Use your own SSL Certificate and Key
2: Use Let's Encrypt to create SSL Certificate and Key
3: Use BuyPass to create SSL Certificate and Key
4: Use ZeroSSL to create SSL Certificate and Key
Enter 1, 2, 3 or 4: 3
Using 301 to Redirect HTTP to HTTPS? (y/n) y
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2022-11-15 19:39:10 | 显示全部楼层

momomo 发表于 2022-11-15 11:19
谢谢, 回复。
看了官网了后,

应该是有其他其中的配置文件有冲突,没有配置文件不确定

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2022-11-15 21:32:49 | 显示全部楼层

licess 发表于 2022-11-15 19:39
应该是有其他其中的配置文件有冲突,没有配置文件不确定

用宝塔部署的话, 添加伪静态 如下:
location / {      if (!-e $request_filename){              rewrite ^(.*)$ /index.php?s=$1 last; break;      }}


程序是可以安装成功的。
应该如何排查呢?如果我们想坚持使用lnmp的话?
 楼主| 发表于 2022-11-15 21:52:35 | 显示全部楼层

licess 发表于 2022-11-15 19:39
应该是有其他其中的配置文件有冲突,没有配置文件不确定

cat yuming.com.conf
server
    {
        listen 80;
        listen [::]:80;
        server_name www.yuming.com ;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/www.yuming.com;

        #include rewrite/laravel.conf;
        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include enable-php-pathinfo.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }

        #location / {
        #    return 301 https://$host$request_uri;
        #}

        access_log  /home/wwwlogs/www.yuming.com.log;
    }

server
    {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name www.yuming.com ;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/www.yuming.com;

        ssl_certificate /usr/local/nginx/conf/ssl/www.yuming.com/fullchain.cer;
        ssl_certificate_key /usr/local/nginx/conf/ssl/www.yuming.com/www.yuming.com.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_prefer_server_ciphers on;
        ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
        ssl_session_cache builtin:1000 shared:SSL:10m;
        # openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
        ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;

        include rewrite/laravel.conf;
        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include enable-php-pathinfo.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.well-known {
            allow all;
        }


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

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/www.yuming.com.log;
    }
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2022-11-16 10:09:39 | 显示全部楼层

momomo 发表于 2022-11-15 21:52
cat yuming.com.conf
server
    {

https的虚拟主机里面有laravel的和你自己添加的两个伪静态
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2022-11-17 14:08:08 | 显示全部楼层

licess 发表于 2022-11-16 10:09
https的虚拟主机里面有laravel的和你自己添加的两个伪静态

嗯 应该删那里呢 ?

军哥运维代购:http://shop63846532.taobao.com/

发表于 2022-11-18 08:44:34 | 显示全部楼层



momomo 发表于 2022-11-17 14:08
嗯 应该删那里呢 ?

你程序伪静态和laravel一样就留laravel的,不一样就留你自己添加的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-4 11:29 , Processed in 0.029212 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表