nginx php-fpm conf文件编写
coco.conf
##upstream
upstream php_coco_backend{
server 127.0.0.1:8019;
}
server {
listen 80;
server_name 139.224.68.68;
location / {
root htdocs_coco;
index shop_index.php;
}
error_page 404 /shop/404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root htdocs_coco;
}
location ~* \.(js|css|jpg|ico|gif|png|jpeg|mp3|wav|exe)$ {
root htdocs_coco;
}
location ~* \.(log)$ {
root htdocs_coco;
default_type text/plain;
}
location ~ \.php$ {
root htdocs_coco;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 60s;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_pass http://php_coco_backend;
}
location ~* /demo/ivr/startservice([\w]*)$ {
root htdosc_coco;
rewrite ^/demo/ivr/startservice([\w]*)$ /demo/ivr/startservice.php?$1 last;
}
#ajax --start
#location ~* /ajax-([a-zA-Z0-9]*)/([a-zA-Z0-9]*)/([a-zA-Z0-9]*)\.ajax([\w]*)$ {
# rewrite ^/ajax-([a-zA-Z0-9]*)/([a-zA-Z0-9]*)/([a-zA-Z0-9]*)\.ajax([\w]*)$ /ajax/processor.php?directory=$1&subdirectory=$2&file=$3 last;
#}
#ajax --end
#api --start
location ~* /if/app/([\w]*)$ {
root htdosc_coco;
rewrite ^/if/app/([\w]*)$ /if/app/processor.php?$1 last;
}
#api --end
#ajax --start
location ~* /invokingAjax-([a-zA-Z0-9]*)/([a-zA-Z0-9]*)/([a-zA-Z0-9]*)\.ajax([\w]*)$ {
rewrite ^/invokingAjax-([a-zA-Z0-9]*)/([a-zA-Z0-9]*)/([a-zA-Z0-9]*)\.ajax([\w]*)$ /invokingAjax/processor.php?directory=$1&subdirectory=$2&file=$3 last;
}
#ajax --end
#onlinepay --start
location ~* /onlinepay/([a-zA-Z0-9]*)/([a-zA-Z0-9]*)/([a-zA-Z0-9]*)\.html([\w]*)$ {
rewrite ^/onlinepay/([a-zA-Z0-9]*)/([a-zA-Z0-9]*)/([a-zA-Z0-9]*)\.html([\w]*)$ /onlinepay/$1/$3.php?subsite=$2 last;
}
#onlinepay --end
#----------------- shop start -----------------#
#-------index default
location ~* /shop/([0-9]+)/index\.html([\w]*)$ {
root htdocs_coco;
try_files /shop/html_cache/index/$1/index.html @fallback_index_default;
}
location @fallback_index_default {
rewrite /shop/([0-9]+)/index\.html([\w]*)$ /index.php?city_id=$1&subsite=shop last;
}
#-------goods
location ~* /shop/goods-([a-zA-Z0-9]+)\.html([\w]*)$ { root htdocs_coco; try_files /shop/html_cache/goods/goods-$1.html @fallback_goods; }
location @fallback_goods { rewrite ^/shop/goods-([a-zA-Z0-9]+)\.html([\w]*)$ /shop/goods.php?uid=$1&subsite=shop last; }
#-------article
location ~* /shop/article-([\d]+)\.html([\w]*)$ { root htdocs_coco; try_files /shop/html_cache/article/article-$1.html @fallback_article; }
location @fallback_article { rewrite ^/shop/article-([\d]+)\.html([\w]*)$ /shop/article.php?aid=$1&subsite=shop last; }
#-------center
location ~* /shop/contentCenter-([\d]+)\.html([\w]*)$ { root htdocs_coco; try_files /shop/html_cache/contentCenter/contentCenter-$1.html @fallback_contentCenter; }
location @fallback_contentCenter { rewrite ^/shop/contentCenter-([\d]+)\.html([\w]*)$ /shop/contentCenter.php?id=$1&subsite=shop last; }
#-------articlelist
location ~* /shop/([a-zA-Z0-9]*)/articlelist-([\d]+)-([\w]*)\.html$ { root htdocs_coco; try_files /shop/html_cache/articlelist/$1/articlelist-$2-$3.html @fallback_articlelist; }
location @fallback_articlelist { rewrite ^/shop/([a-zA-Z0-9]*)/articlelist-([\d]+)-([\w]*)\.html$ /shop/articlelist.php?index=$1&page=$2&extend=$3&subsite=shop last; }
location ~* /shop/([\w]+).html([\w]*)$ { rewrite ^/shop/([\w]+).html([\w]*)$ /shop/$1.php?subsite=shop last; }
location ~* /shop/activity/([\w]+).html([\w]*)$ { rewrite ^/shop/activity/([\w]+).html([\w]*)$ /shop/activity/$1.php?subsite=shop last; }
location ~* /activity/([\w]+)/([\w]+).html([\w]*)$ { rewrite ^/activity/([\w]+)/([\w]+).html([\w]*)$ /shop/activity/$1/$2.php?subsite=shop last; }
#----------------- shop end -----------------#
#location ~* /quanliadmin/ {
# rewrite ^/quanliadmin/app/([a-zA-Z0-9]*)/([a-zA-Z0-9]*)\.pscript([\w\W]*)$ /quanliadmin/processor.php?dict=$1&action=$2&subsite=backend last;
# index /quanliadmin/login.php;
#}
location ~* /quanliadmin/ {
rewrite /quanliadmin/app/([a-zA-Z0-9]*)/([a-zA-Z0-9]*)\.pscript([\w\W]*)$ /quanliadmin/processor.php?dict=$1&action=$2&subsite=backend last;
index /quanliadmin/login.php;
}
#-------------------------------------------------------------------- wap start ------------------------------------------------------------------------------------#
location = /wap/ {
root htdocs_coco;
index /wap/wap_index.php;
}
#-------index default
location ~* /wap/([0-9]+)/index\.html([\w]*)$ {
root htdocs_coco;
try_files /wap/html_cache/index/$1/index.html @fallback_wap_index_default;
}
location @fallback_wap_index_default {
rewrite /([0-9]+)/index\.html([\w]*)$ /wap/index.php?city_id=$1&subsite=wap last;
}
#-------list default
location ~* /wap/list-([a-zA-Z0-9]+)\.html([\w]*)$ { root htdocs_coco; try_files /wap/html_cache/list/$1/list-$1-sale-desc-1.html @fallback_wap_list_default; }
location @fallback_wap_list_default { rewrite ^/wap/list-([a-zA-Z0-9]+)\.html$ /wap/list.php?uid=$1&sortby=sale&sort=desc&pageindex=1&subsite=wap last; }
#-------wap list full
location ~* /wap/list-([a-zA-Z0-9]+)-(sale|price|update|discount)-(asc|desc)-([\d]+)\.html([\w]*)$ { root htdocs_coco; try_files /wap/html_cache/list/$1/list-$1-$2-$3-$4.html @fallback_wap_list_full; }
location @fallback_wap_list_full { rewrite ^/wap/list-([a-zA-Z0-9]+)-(sale|price|update|discount)-(asc|desc)-([\d]+)\.html([\w]*)$ /wap/list.php?uid=$1&sortby=$2&sort=$3&pageindex=$4&subsite=wap last; }
#-------center
location ~* /wap/contentCenttartr-([\d]+)\.html([\w]*)$ { root htdocs_coco; try_files /wap/html_cache/contentCenter/contentCenter-$1.html @fallback_wap_contentCenter; }
#end-----------------#
#----------------- coquetry end -------------------#
location @fallback_wap_contentCenter { rewrite ^/wap/contentCenter-([\d]+)\.html([\w]*)$ /wap/contentCenter.php?id=$1&subsite=wap last; }
#-------goods
location ~* /wap/goods-([a-zA-Z0-9]+)\.html([\w]*)$ { root htdocs_coco; try_files /wap/html_cache/goods/goods-$1.html @fallback_wap_goods; }
location @fallback_wap_goods { rewrite ^/wap/goods-([a-zA-Z0-9]+)\.html([\w]*)$ /wap/goods.php?uid=$1&subsite=wap last; }
location ~* /wap/([\w]+).html([\w]*)$ { rewrite ^/wap/([\w]+).html([\w]*)$ /wap/$1.php?subsite=wap last; }
#-------wap activity
location ~* /hd/([\w]*)/([\w]*).html([\w]*)$ { root htdocs_coco; try_files /wap/html_cache/activity/$1/$2.html @fallback_wap_activity_full; }
location @fallback_wap_activity_full { rewrite ^/hd/([\w]*)/([\w]*).html([\w]*)$ /wap/activity/$1/$2.php?subsite=wap last; }
#------------------------------------------------------------------------- wap end ----------------------------------------------------------------------------------#
#----------------- dunch start -----------------#
location ~* /dunch/([\w]+).html([\w]*)$ { rewrite ^/dunch/([\w]+).html([\w]*)$ /dunch/$1.php?subsite=dunch last; }
#----------------- dunch end -----------------#
#----------------- coquetry start -----------------#
location ~* /dunch/coquetry/([\w]+).html([\w]*)$ { rewrite ^/dunch/coquetry/([\w]+).html([\w]*)$ /dunch/coquetry/$1.php?subsite=dunch last; }
#----------------- coquetry end -------------------#
#------------------------------------------------------yan zheng ma start----------------------------------------------------------------------------------------------
location ~* /core/yzm.html([\w]*)$ { rewrite ^/core/yzm.html([\w]*)$ /core/yzm.php?subsite=wap last; }
#------------------------------------------------------yan zheng ma end -------------------------------------------------------------------------------------#
}
gitlab-nginx.conf
## GitLab 8.3+
##
## Lines starting with two hashes (##) are comments with information.
## Lines starting with one hash (#) are configuration parameters that can be uncommented.
##
##################################
## CONTRIBUTING ##
##################################
##
## If you change this file in a Merge Request, please also create
## a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
##
###################################
## configuration ##
###################################
##
## See installation.md#using-https for additional HTTPS configuration details.
upstream gitlab-workhorse {
server 127.0.0.1:8083;
}
## Normal HTTP host
server {
## Either remove "default_server" from the listen line below,
## or delete the /etc/nginx/sites-enabled/default file. This will cause gitlab
## to be served if you visit any address that your server responds to, eg.
## the ip address of the server (http://x.x.x.x/)n 0.0.0.0:80 default_server;
listen 0.0.0.0:80 default_server;
##listen [::]:80 default_server;
server_name code.jwsmed.com; ## Replace this with something like gitlab.example.com
server_tokens off; ## Don't show the nginx version number, a security best practice
root /opt/gitlab/embedded/service/gitlab-rails/public;
## See app/controllers/application_controller.rb for headers set
## Individual nginx logs for this GitLab vhost
##access_log /var/log/nginx/gitlab_access.log;
##error_log /var/log/nginx/gitlab_error.log;
location / {
client_max_body_size 0;
gzip off;
## https://github.com/gitlabhq/gitlabhq/issues/694
## Some requests take more than 30 seconds.
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://gitlab-workhorse;
}
}
new.conf
server {
listen 80;
server_name sen.luoluo.com;
root /usr/share/nginx/html/;
index index.html index.htm;
try_files $uri $uri/ /index.html;
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
location ~ ^/api/ {
proxy_pass http://192.168.10.10:9091;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ ^/rest/ {
proxy_pass http://192.168.10.10:9092;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /config {
proxy_pass http://192.168.10.10:8761;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
rewrite ^(.*)/config$ $1/config/web/test/master/web-config.json;
}
}
pad.conf
server {
listen 80;
server_name sen.luoluo.com;
root /usr/share/nginx/html/web/;
index index.html index.htm;
try_files $uri $uri/ /index.html;
#charset koi8-r;
access_log /usr/share/nginx/html/webaccess.log main;
location ~ ^/api/ {
proxy_pass http://192.168.10.10:9096;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ ^/rest/ {
proxy_pass http://43.93.211.222:8080;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#区分手机、电脑
location ~ ^/cas {
set $mobile 0;
if ($http_user_agent ~* "iphone|android") {
set $mobile 1;
}
if ($mobile = 0) {
return 302 /pay.html?$args;
}
if ($mobile = 1) {
return 302 /ment/cashier?$args;
}
}
location /config {
proxy_pass http://192.168.10.10:8671;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
rewrite ^(.*)/config$ $1/config/test/master/config.json;
}
}
psur.conf
server {
listen 192.168.10.10:9094;
index index.html index.htm index.php;
root /usr/local/src/public/public;
location ~ .*\.(php|phtml)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
try_files $uri public/$uri @rewrite;
location @rewrite{
if (!-e $request_filename) {
rewrite ^/public/(.*)$ /$1 last;
}
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?_url=/$1 last;
}
}
location ~ .*\.(htm|html|gif|jpg|jpeg|png|bmp|ico|swf|flv|js|css)$ {
root /usr/local/src/public/public;
expires 30d;
}
location ~ /\.ht {
deny all;
}
#access_log_bypass_if ($status = 404)
access_log /usr/local/src/public/public/access.log main;
}
xwms.conf
server {
listen 8088;
server_name 47.93.2.11;
index index.html index.htm index.php;
root /usr/share/nginx/html/code;
location ~ \.php/ {
if ($request_uri ~ ^(.+\.php)(/.+?)($|\?)) { }
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_NAME $1;
fastcgi_param PATH_INFO $2;
fastcgi_param SCRIPT_FILENAME $document_root$1;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
product.conf
server {
listen 86;
server_name 118.178.242.213;
index index.html index.htm index.php;
root /home/product;
location ~ .*\.(php|phtml)?$ {
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
include fastcgi.conf;
}
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ /\.ht {
deny all;
}
#access_log_bypass_if ($status = 404)
#access_log /usr/local/src/access.log main;
}
nginx php-fpm conf文件编写的更多相关文章
- nginx新建nginx_fzjh.conf文件,不使用默认配置文件
worker_processes 4; events{ worker_connections 1024; } http{ server { listen 80; server_name myserve ...
- 借用nginx.vim工具进行语法高亮和格式化配置nginx.conf文件
在生产环境中,我们肯定经常用到nginx.conf文件的编排工作,今天在阅读<决战nginx>的时候无意间看到nginx.vim这个辅助工具,于是百度搜索和实际部署检测了一下,其效果确实让 ...
- 虚拟主机ip配置,nginx.conf文件配置及日志文件切割
今天粗略整理了一下虚拟主机配置,nginx.conf文件的配置,及日志文件的切割,记录如下: nginx虚拟主机配置:1.IP地址配置,2.绑定ip地址和虚拟主机详情:1.ip地址的配置:ifconf ...
- nginx如何利用自定义的conf文件启动?
1.进入nginx的安装目录; 2.nginx -s -c conf/my.conf (校验该文件是否有效) nginx -s -c conf/my.conf 命令会卡死,存疑 3.start ...
- Centos7安装nginx后提示“Welcome to nginx on Fedora!”,conf.d目录下无default.conf文件
问题描述 在腾讯云centos7上安装nginx sudo yum install nginx 打开默认网页显示 Welcome to nginx on Fedora! 且 /etc/nginx/co ...
- Dockerfile + Nginx.conf文件记录(用于前端项目部署)
Dockerfile + Nginx.conf文件记录(用于前端项目部署) 本教程依据个人理解并经过实际验证为正确,特此记录下来,权当笔记. 注:基于linux操作系统(敏感信息都进行了处理),默认服 ...
- Linux安装Tomcat-Nginx-FastDFS-Redis-Solr-集群——【第十一集补充:修改fastdfs的http.conf文件进行防盗链,重启nginx失败】
1,进入fastdfs的安装目录: 2,修改http.conf文件,详情可参考: https://www.cnblogs.com/xiaolinstudy/p/9341779.html 3,重启ngi ...
- 在k8s中将nginx.conf文件内容创建为ConfigMap挂载到pod容器中
将nginx.conf文件内容创建为ConfigMap user nginx; worker_processes auto; error_log /var/log/nginx/error.log er ...
- nginx conf 文件
server { listen ; server_name local.light.com; index index.html index.htm index.php; root /home/wwwr ...
随机推荐
- Linux sed使用方法
目录 sed处理流程 测试数据 sed命令格式 sed命令行格式 行定位 定位1行 定位区间行(多行) 定位某一行之外的行 定位有跨度的行 操作命令 -a (新增行) -i(插入行) -c(替代行) ...
- 【问题解决方案】之 cmd 窗口问题汇总
cmd窗口C盘切不到其他盘的解决方案: 1.切换盘符,直接键入其他盘,如:>>D: (回车) 2.强行切换>>cd /d D: 或者 >>pushd C:
- sql学习内容记录
1.left函数 left(字段,长度):获取指定字段左侧的数据,类似substring函数 2.union / union all 将多个记录合并成一个完整的数据集 3.insert into se ...
- 文件传输协议FTP、SFTP和SCP
网络通信协议分层 应用层: HTTP(Hypertext Transfer Protocol 超文本传输协议,显示网页) DNS(Domain Name System) FTP(File Transf ...
- K3 WISE安全认证方式
k/3中间层注册三种安全认证方式: 交互式用户方式,网络服务方式,信任方式,是指组件服务中生成的COM+应用程序中的组件包的运行账户(注册中间层后产生很多ebo开头的和kdsvrmgr组件包). 三种 ...
- springboot的几种启动方式
一:IDE 运行Application这个类的main方法 二:在springboot的应用的根目录下运行mvn spring-boot:run 三:使用mvn install 生成jar后运行 先到 ...
- React Native & Google & Proxy
React Native & Google & Proxy https://snack.expo.io/ https://expo.io/snacks/@xgqfrms https:/ ...
- python设计模式第二十天【模版方法模式】
1.应用场景 (1)具有相同的操作,但是步骤中具有不同的操作细节 2.代码实现 #!/usr/bin/env python #! _*_ coding:UTF-8 _*_ from abc impor ...
- python数据结构与算法第十四天【二分查找】
1.二分查找的原理 对于已经排序的列表进行最快速度的查找 2. 代码实现 (1)递归实现 def binary_search(alist, item): if len(alist) == 0: ret ...
- jquery获取select选择的文本与值
jquery获取select选择的文本与值获取select :获取select 选中的 text : $("#ddlregtype").find("option:s ...