#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. Codeforces Round #242 (Div. 2) B. Megacity

    按照半径排序,然后累加人数直到超过百万 #include <iostream> #include <algorithm> #include <cmath> #inc ...

  2. NOIp 2014 #1 生活大爆炸版石头剪刀布 Label:模拟

    题目描述 石头剪刀布是常见的猜拳游戏:石头胜剪刀,剪刀胜布,布胜石头.如果两个人出拳一样,则不分胜负.在<生活大爆炸>第二季第8 集中出现了一种石头剪刀布的升级版游戏. 升级版游戏在传统的 ...

  3. BZOJ2844: albus就是要第一个出场

    Description 已知一个长度为n的正整数序列A(下标从1开始), 令 S = { x | 1 <= x <= n }, S 的幂集2^S定义为S 所有子集构成的集合. 定义映射 f ...

  4. SQLSERVER远程备份、恢复(转)

    SQLSERVER服务实例名称:192.168.0.2需要备份的数据库名称: a备份机器名称(Client端):192.168.0.3备份机用户:zf 密码:123备份机域名:domain备份机提供备 ...

  5. Hibernate笔试总结

    1.在Hibernate中,以下关于主键生成器说法错误的是(AC). A.increment可以用于类型为long.short或byte的主键. B.identity用于如SQL Server.DB2 ...

  6. html5响应式设置<meta>

    <meta name="viewport" content="width=device-width, initial-scale=1.0"> < ...

  7. HDU 2546

    饭卡 Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submiss ...

  8. 安装redis,执行make test时遇到You need tcl 8.5 or newer in order to run the Redis test

    安装他yum install tcl

  9. 导出所选行为excle

    要实现的是将所选行导出.例如勾选这两条

  10. jquery ui dialog去掉右上角的叉号

    var dialog = $("#id").dialog({ resizable:false, height:, width:, zIndex:, modal:true, open ...