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 ...
随机推荐
- node.js 实现一个简单的登录拦截器
拦截器在web开发中随处可见,比如站点的管理后台,不说所有人都能进入,所以就需要做一个拦截器并友好的跳转到提示页. 下面我们简单实现一种,判断用户是否登录成功,登录不成功的用户自动重定向到登录页面. ...
- 微信客户端自带的Js Api:WeixinJSBridge
<!DOCTYPE html> <html> <head> <title>微信WeixinJSBridge API</title> < ...
- BZOJ1012[JSOI2008]最大数maxnumber 题解
题目大意: 维护一个数列,有两种操作:1. 查询当前数列中末尾L个数中的最大的数,并输出这个数的值.限制:L不超过当前数列的长度.2.插入操作:将n加上t,其中t是最近一次查询操作的答案(如果还未执行 ...
- 【BZOJ2049】 [Sdoi2008]Cave 洞穴勘测 LCT/并查集
两种方法: 1.LCT 第一次LCT,只有link-cut和询问,无限T,到COGS上找了数据,发现splay里的父亲特判出错了(MD纸张),A了,好奇的删了反转T了.... #include < ...
- 属性字符串的replaceCharactersInRange方法
一,实验: 1> 让 range 的 length 参数为0,以下代码输出属性字符串的结果为12354 NSMutableAttributedString *attrStr = [[NSMuta ...
- jQuery取得select选中的值
$("#sxselect").change(function(){ alert($("#sxselect option:selected").val()); } ...
- SpringMVC+Thymeleaf如何处理URL中的动态查询参数
1.使用一个Map<String, String>接收数据 When you request a Map annotated with @RequestParam Spring creat ...
- python算法——第四天
一.递归 def func(num): if num / 2 > 0: num -= 1 print(num) num = func(num) print('quit') return num ...
- python进阶学习三——第四天
一. iter&yield迭代器 1.1 iter names = iter(['zeng', 'chun', 'yun']) print(names) print(names.__next_ ...
- Error #include nested too deeply
转载:http://blog.csdn.net/ysdaniel/article/details/7043395 出现 Error #include nested too deeply 原因是: 头文 ...