Nginx配置Yii:backend&frontend
#My vlson.top project
#frontend
server {
listen 80;
server_name www.vlson.com; #charset koi8-r; set $app_root F:/vlson/advanced/frontend/web/;
set $project_root F:/vlson/advanced/frontend/;
root $app_root; access_log logs/frontend.access.log main; location / {
root $app_root;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
} error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root F:/vlson/frontend/web/;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php(.*)$ {
root F:/vlson/advanced/frontend/web/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
} #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${
# #expires 30d;
# root $project_root;
#}
#location ~ .*\.(js|css)?${
# root $project_root;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
#My vlson.top project
#backend
server {
listen 80;
server_name backend.vlson.com;
client_max_body_size 5M; #charset koi8-r;
set $app_root F:/vlson/advanced/backend/web/;
set $project_root F:/vlson/advanced/backend/;
root $app_root; access_log logs/backend.access.log main; location / {
#root $app_root;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
} error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root $app_root;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php(.*)$ {
root F:/vlson/advanced/backend/web/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
Nginx配置Yii:backend&frontend的更多相关文章
- 针对Yii框架的nginx配置
我曾经针对yii制作了 个nginx配置,其中包括了以下几项内容: rewrite规则(try_file),需要nginx0.8.6版本以上支持. 针对于icon, robots.txt文件的日志优化 ...
- Nginx 配置简述
不论是本地开发,还是远程到 Server 开发,还是给提供 demo 给人看效果,我们时常需要对 Nginx 做配置,Nginx 的配置项相当多,如果考虑性能配置起来会比较麻烦.不过,我们往往只是需要 ...
- NGINX 配置 SSL 双向认证
对于 NGINX 的 HTTPS 配置,通常情况下我们只需要实现服务端认证就行,因为浏览器内置了一些受信任的证书颁发机构(CA),服务器端只需要拿到这些机构颁发的证书并配置好,浏览器会自己校验证书的可 ...
- 使用etcd+confd管理nginx配置
1.前言 最近在项目中用nginx做反向代理,需要动态生成nginx的配置.大概流程是用户在页面上新增域名.http或https协议以及端口信息,后台会根据域名自动生成一个nginx的server配置 ...
- nginx配置pathinfo支持,最佳方案 - chunyu
〇. 前言 pathinfo有两个,1 pathinfo()函数,2 $_SERVER['PATH_INFO'].pathinfo()是php的库函数,原生支持不需要nginx配置,$_SERVER[ ...
- Nginx配置了解
安装Nginx常用编译选项说明 nginx大部分常用模块,编译时./configure --help查看,以--without开头的都是默认安装. --prefix=PATH 指定nginx的安装目录 ...
- Nginx配置静态资源
静态服务器 静态服务器概念非常简单:当用户请求静态资源时,把文件内容回复给用户. 但是,要把静态服务做到极致,需要考虑的方面非常多: 正确书写header:设置content-type.过期时间等 效 ...
- Nginx 配置TCP代理
Nginx 1.9 版本以后增加了stream模块,可以对tcp,udp请求进行代理和负载均衡了,今天来体验一下首先编译安装过程configure的时候增加选项 --with-stream --wit ...
- 初识nginx——配置解析篇
一.nginx的介绍 nginx是由俄罗斯人开发的一款高性能的http和反向代理服务器,也可以用来作为邮件代理.相比较于其他的服务器,具有占用内存少,稳定性高等优势 二.nginx的配置 nginx的 ...
随机推荐
- Linux创建用户,SFTP只允许访问指定目录
首先创建用户 useradd lus1passwd lus1 我这里配置lus1这个用户目录,为sftp指向目录,即/home/lus1/ vim /etc/ssh/sshd_config //这个记 ...
- odoo开发笔记 -- 借助模块queue_job实现异步方法调用
场景描述: 对比了几个定时调度的框架,发现各有优缺点: celery 很强,异步定时调度,异步周期调度,也有延时调度的功能,但是延时调度的案例比较少,遂暂时不使用. queue_job,一个odoo第 ...
- 设置驱动的方法(Chrome 亲测ok)
驱动下载地址 http://selenium-release.storage.googleapis.com/index.html package com.selenium.java.webdriver ...
- koa2 post请求ctx.request.body空获取不到的解决办法
header请求头添加Content-type: application/json
- [INet] 借助 HTTP Cache 加速应用响应
背景: GET 访问一个应用的时候,内容一般都不会时刻在变,如何让下一个人请求时极速获取响应过的内容,并且在内容发生变更时能够识别出来. 在应用层做 Cache 是一种方法,但是依旧要响应整个 Bod ...
- fail2ban的功能和特性(实测)
fail2ban的功能和特性 https://fedoraproject.org/wiki/Fail2ban_with_FirewallD 1.支持大量服务.如sshd,apache,qmail,pr ...
- [转]python file文件操作--内置对象open
python file文件操作--内置对象open 说明: 1. 函数功能打开一个文件,返回一个文件读写对象,然后可以对文件进行相应读写操作. 2. file参数表示的需要打开文件的相对路径(当前 ...
- SQL"已更新或者删除的行值要么不能使该行成为唯一行,要么改变了多个行(X行)“解决办法
这种问题大多是由于没有主键(PK)导致同一张表中存在若干条相同的数据.DBMS存储时,只为其存储一条数据,因为DBMS底层做了优化,以减少数据冗余.所以删除或更新一条重复数据就牵一发而动全身. 解决方 ...
- linux查看openssh和openssl版本
查看 openssh 版本命令 ssh -V 查看 openssl 版本命令 openssl version
- 安装nginx1.16.1版本
安装nginx1.16.1版本 一.添加源 到 cd /etc/yum.repos.d/ 目录下 新建nginx.repo 文件 vim nginx.repo 输入以下信息 [nginx-stable ...