nginx yii2环境配置
#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环境配置的更多相关文章
- Nginx 测试环境配置,留作笔记使用
Nginx 测试环境配置,留做笔记 以下全是配置文件的配置,如果有疑问还请移步Nginx官网参考官方文档. 环境: [root@CentOS6-M01 conf]# cat /etc/redhat-r ...
- wordpress nginx详细环境配置安装命令和相关问题解决
很详细的有关WordPress和nginx的环境配置安装操作步骤 指南,适合新手一步步按照命令操作安装WordPress并运行在生产环境中. 操作步骤转载自: Heap Stack blog(ping ...
- Yii2 环境配置生产环境和测试环境
默认的Debug配置 在入口文件web/index.php中 defined('YII_DEBUG') or define('YII_DEBUG', true);defined('YII_ENV') ...
- WindowsOS下Nginx+PHP环境配置
Nginx 配置虚拟主机 在conf目录中的nginx.conf中最后一行前面加上 include vhost/*.conf; 在conf目录中添加一个文件夹vhost(此文件夹用来保存Nginx虚拟 ...
- Nginx TP5环境配置
Apache默认支持Pathinfo模式 Nginx不支持 需要手动配置 Apache默认支持Pathinfo模式 Nginx不支持 需要手动配置 server { #配置监听端口 list ...
- nginx的环境配置的问题
在安装好nginx之后,运行nginx,报错: nginx dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib Referenced fr ...
- Lua:Nginx Lua环境配置,第一个Nginx Lua代码
一.编译安装LuaJIT Lua:编译安装LuaJIT,第一个Lua程序 http://blog.csdn.net/guowenyan001/article/details/48250427 二.下载 ...
- Django+Nginx+Uwsgi环境配置
nginx.conf : server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.acces ...
- Yii2中的入口文件环境配置
默认的Debug配置 在入口文件中 defined ( 'YII_DEBUG' ) or define ( 'YII_DEBUG', true ); defined ( 'YII_ENV' ) or ...
随机推荐
- ACM: 限时训练题解-Epic Professor-水题
Epic Professor Dr. Bahosain works as a professor of Computer Science at HU (Hadramout Universit ...
- 转:关于垂直网格与CSS基线对其的探讨
网页设计布局中一直比较流行网格对齐,但只是针对水平的对齐,很少或者没有涉及垂直对齐,这篇文章很详细的讲解了垂直网格,乃至基线对其的相关,而css3中的多列布局的也使其显得更为重要,因此还是很有必要去了 ...
- [深入浅出WP8.1(Runtime)]数据绑定的基础
11.1 数据绑定的基础 数据绑定是一种XAML界面和后台数据通信的方式,因为界面和后台数据的通信的场景有多种,并且数据于数据之间也存在着不一样的关联关系,所以数据绑定的实现技巧和方式也是多种多样的. ...
- css learn
float: 1.margin属性本身与float无关.写不写float都可以margin. 2.top,right,bottom,left和z-index都无法使用. 3.父元素浮动,子元素在其中仍 ...
- reason: '*** Collection <__NSCFArray: 0x7ffa43528f70> was mutated while being enumerated.'
一,错误分析 1.崩溃代码如下: //遍历当前数组,判断是否有相同的元素 for (NSString *str in self.searchHistoryArrM) { if ([str isEqua ...
- nodejs高大上的部署方式-PM2
1.最常用的属nohup了,其实就是在后台执行进程,末尾加个& [zhoujie@ops-dev ~]$ nohup node /home/zhoujie/ops/app.js & ...
- CentOS7 网络管理相关命令
contos7 网卡配置文件自动识别ifcfg开头的文件(包括目录) CentOS7网卡命名规则: CentOS 7 开始对于网卡的编号则有另一套规则, 网卡的界面代号现在与网卡的来源有关,基本上的网 ...
- windows 给ping加时间
@echo off set /p host=host Address: set logfile=Log_%host%.log echo Target Host = %host% >%logfil ...
- markdown语法学习笔记
##1.**标题** # 一级标题 ## 二级标题 ### 三级标题 #### 四级标题 ##### 五级标题 ###### 六级标题 ##2.**加粗** 首尾各加两个*号 ##3.*斜字体 ...
- HTML5初学总结
基本标签的使用 <!doctype html> <!--这是HTML5的申明,大小写都可以--> <html> <head> <title> ...