Ubuntu 搭建 Nginx

7-13 911 views

安装Nginx

sudo apt-get install nginx

启动Nginx

sudo /etc/init.d/nginx restart

配置文件

/etc/nginx/

启用配置文件

ln -s /etc/nginx/sites-available/fly3w /etc/nginx/sites-enabled/fly3w

支持PHP

sudo apt-get install php5-fpm
vim /etc/php5/fpm/pool.d/www.conf

修改 listen

#listen = /var/run/php5-fpm.sock
listen = 127.0.0.1:9527

启动 php5-fpm

/etc/init.d/php5-fpm restart

添加站点

server {
  listen       80;
  server_name  fly3w.com www.fly3w.com
  access_log   logs/www.fly3w.com.log  main;
  root         /var/www/www.fly3w.com;
  index        index.php;

  location ~ \.php$ {
     try_files $uri =404;
     fastcgi_pass   127.0.0.1:9527;
     fastcgi_index index.php;
     include fastcgi_params;
  }
}

启用代理

server {
  listen       80;
  server_name  restful.cc www.restful.cc
  access_log   logs/www.restful.cc.log  main;

  location / {
      proxy_pass      http://127.0.0.1:8888;
  }
}

WordPress Rewrite


  location / {
    # This is cool because no php is touched for static content.
    # include the "?$args" part so non-default permalinks doesn't break when using query string
    try_files $uri $uri/ /index.php?$args;
  }

  location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    expires max;
    log_not_found off;
  }

  location ~ \.php$ {
    if (-f $request_filename/index.html){
      rewrite (.*) $1/index.html break;
    }

    if (-f $request_filename/index.php){
      rewrite (.*) $1/index.php;
    }

    if (!-f $request_filename){
      rewrite (.*) /index.php;
    }
     fastcgi_pass   127.0.0.1:9527;
     fastcgi_index index.php;
     include fastcgi_params;
  }

开启Https

typescript 源码分析

https://www.cnblogs.com/xuld/p/12180913.html

阅读全文

flutter_gen config

const configDefaultYamlContent = ''' name: UNKNOWN flutter_gen: Optional output: lib/gen/ Optional line_length: 80 Optional parse_metadata: false ...

阅读全文

redis 函数的含义

您提供的函数列表是一个 Redis 客户端 API 的部分实现,通常用于与 Redis 数据库进行交互。以下是这些函数的简要解释,按类别进行分类以帮助理解其功能和用...

阅读全文

欢迎留言