momomo 发表于 2022-11-15 06:08:33

acg-faka lnmp. Nginx 伪静态,leveral

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


卡在了

请先设置伪静态后在安装程序。


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


licess 发表于 2022-11-15 10:53:52

https://lnmp.org/faq/lnmp-vhost-add-howto.html 官网有伪静态的使用教程

momomo 发表于 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: duplicate location "/" in /usr/local/nginx/conf/vhost/www.域名.com.conf:84
failed

补充内容 (2022-11-15 11:46):
sudo lnmp nginx restart

momomo 发表于 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

licess 发表于 2022-11-15 19:39:10

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



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

momomo 发表于 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的话?

momomo 发表于 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;
    }

licess 发表于 2022-11-16 10:09:39

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


https的虚拟主机里面有laravel的和你自己添加的两个伪静态

momomo 发表于 2022-11-17 14:08:08

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

嗯 应该删那里呢 ?

licess 发表于 2022-11-18 08:44:34

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

你程序伪静态和laravel一样就留laravel的,不一样就留你自己添加的
页: [1]
查看完整版本: acg-faka lnmp. Nginx 伪静态,leveral