#user nobody;
worker_processes 2;
#worker_cpu_affinity 0001 0010 0100 1000

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

pid logs/nginx.pid;

events {
worker_connections 65535;
use epoll;
}

http {
include mime.types;
default_type application/octet-stream;

log_format access '$http_x_forwarded_for - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" '
'"$upstream_addr" "$upstream_status" "$upstream_response_time" "$request_time"';

error_log logs/error.log info;

sendfile on;
tcp_nopush on;
server_tokens off;
keepalive_timeout 65;
server_names_hash_bucket_size 128;
client_max_body_size 5m;
client_header_buffer_size 128k;
large_client_header_buffers 4 128k;
tcp_nodelay on;

#fastcgi_cache_path /data/nginx/fastcgi_cache levels=1:2 keys_zone=test:10m inactive=5m;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
#fastcgi_cache TEST;
#fastcgi_cache_valid 200 302 1h;
#fastcgi_cache_valid 301 1d;
#fastcgi_cache_valid any 1m;

gzip on;
gzip_min_length 1k;
gzip_buffers 16 64k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain application/x-javascript application/javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/jpg image/gif image/png images/jpeg images/jpg images/gif images/png application/json text/xml application/xml+rss;
gzip_vary on;
gzip_disable "MSIE [1-6].";

upstream abcdadmin {

server 127.0.0.1:9000;
}

upstream abcdapi {

server 127.0.0.1:9000;
}

server {

listen 80;

server_name www.abc.com;

root /data/webserver/adminabcd/backend/web;

index index.php;

location / {

index index.php;
if (!-e $request_filename){
rewrite ^/(.*) /index.php last;
}
}

location ~.*\.(php|php5)?$ {
root /data/webserver/adminabcd/backend/web;
fastcgi_pass abcdadmin;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

server {

listen 80;

server_name api.abc.com;

root /data/webserver/adminabcd/api/web;

index index.php;

location / {

index index.php;
if (!-e $request_filename){
rewrite ^/(.*) /index.php last;
}
}

location ~.*\.(php|php5)?$ {
fastcgi_pass abcdapi;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

}

nginx yii2环境配置的更多相关文章

  1. Nginx 测试环境配置,留作笔记使用

    Nginx 测试环境配置,留做笔记 以下全是配置文件的配置,如果有疑问还请移步Nginx官网参考官方文档. 环境: [root@CentOS6-M01 conf]# cat /etc/redhat-r ...

  2. wordpress nginx详细环境配置安装命令和相关问题解决

    很详细的有关WordPress和nginx的环境配置安装操作步骤 指南,适合新手一步步按照命令操作安装WordPress并运行在生产环境中. 操作步骤转载自: Heap Stack blog(ping ...

  3. Yii2 环境配置生产环境和测试环境

    默认的Debug配置 在入口文件web/index.php中 defined('YII_DEBUG') or define('YII_DEBUG', true);defined('YII_ENV') ...

  4. WindowsOS下Nginx+PHP环境配置

    Nginx 配置虚拟主机 在conf目录中的nginx.conf中最后一行前面加上 include vhost/*.conf; 在conf目录中添加一个文件夹vhost(此文件夹用来保存Nginx虚拟 ...

  5. Nginx TP5环境配置

    Apache默认支持Pathinfo模式  Nginx不支持  需要手动配置  Apache默认支持Pathinfo模式  Nginx不支持  需要手动配置 server { #配置监听端口 list ...

  6. nginx的环境配置的问题

    在安装好nginx之后,运行nginx,报错: nginx dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib Referenced fr ...

  7. Lua:Nginx Lua环境配置,第一个Nginx Lua代码

    一.编译安装LuaJIT Lua:编译安装LuaJIT,第一个Lua程序 http://blog.csdn.net/guowenyan001/article/details/48250427 二.下载 ...

  8. Django+Nginx+Uwsgi环境配置

    nginx.conf : server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.acces ...

  9. Yii2中的入口文件环境配置

    默认的Debug配置 在入口文件中 defined ( 'YII_DEBUG' ) or define ( 'YII_DEBUG', true ); defined ( 'YII_ENV' ) or ...

随机推荐

  1. NOIp 2013 #2 花匠 Label:爆0的Water

    题目描述 花匠栋栋种了一排花,每株花都有自己的高度.花儿越长越大,也越来越挤.栋栋决定 把这排中的一部分花移走,将剩下的留在原地,使得剩下的花能有空间长大,同时,栋栋希 望剩下的花排列得比较别致. 具 ...

  2. Javascript 多浏览器兼容性问题及解决方案

    一.document.formName.item(”itemName”) 问题 问题说明:IE下,可以使用 document.formName.item(”itemName”) 或 document. ...

  3. display: block; -webkit-margin-before: 1em; -webkit-margin-after: 1em; -webkit-margin-start: 0px; -webkit-margin-end: 0px;

    总的来说:这是CSS3.0的对于文章段P容器的定义方法语句! display:block这个样式,只定义了P容器为一个块; 后面四句是CSS3中的样式定义方法: -webkit-margin-befo ...

  4. 20161004 NOIP 模拟赛 T1 解题报告

    第1题  小麦亩产一千八 [问题描述] “有了金坷垃,肥料一袋能顶两袋撒,小麦亩产一千八,吸收两米下的氮磷钾……”,话说HYSBZ(Hengyang School for Boys & Zy) ...

  5. 【BZOJ1270】1270: [BeijingWc2008]雷涛的小猫 DP

    Description   Input Output Sample Input Sample Output 8 HINT Source 唉这么蠢的Dp没一下子看出来,Dp真是太弱了啦. #includ ...

  6. vsfptd

    如果想通过vsftpd来在主机和虚拟机之间拿数据,可以通过这种方法: 在主机的资源管理器中输入:ftp://虚拟机里面Linux的IP(如192.168.2.112)/ 如果反过来,需要如下:ftp: ...

  7. hadoop CLASSNAME命令使用注意点

    Hadoop中可是使用hadoop CLASSNAME命令.这个CLASSNAME就是你写好的类名.hadoop CLASSNAME命令类似于java classname. 使用hadoop CLAS ...

  8. Facebook通过oAuth验证获取json数据

    首先下载facebook相关的动态库,下载文件:facebook.dll 获取授权token方法: private string SetToken(string gettoken)//此处是你的短to ...

  9. 李洪强iOS经典面试题125

    1.objective-c 是所有对象间的交互是如何实现的? 在对象间交互中每个对象承担的角色不同,但总的来说无非就是"数据的发送者"或"数据的接收者"两种角色 ...

  10. MySQL数据库基本指令(全)

    数据库基本类型 CHAR 固定长度字符串 char(10) 存两位 占10位 查询有优势VARCHAR 可变长度字符串 varchar(10) 存两位 占两位 存储有优势 枚举类型 只能取一个set类 ...