环境是lnmp

  1. Ourls 拉取代码

git clone https://github.com/takashiki/Ourls.git

  1. 建数据表 导入url.sql文件
  2. 重命名 app/config.sample.php 为 app/config.php
  3. 配置nginx 文件重点是要隐藏 index.php 贴一下完整的伪静态

`

    server{
    listen 80;
    server_name url.177ow.com ;
    index index.php;
    root  /home/wwwroot/urls/public;

    #error_page   404   /404.html;
    include enable-php-pathinfo.conf;
    
    if (!-e $request_filename) {
      rewrite ^/(.*)$ /index.php/$1;   
      }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
    }

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

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

    location ~ /\.
    {
        deny all;
    }

    access_log  /home/wwwlogs/url.177ow.com.log;
    }
`

标签: none

添加新评论