coco.conf##upstreamupstream php_coco_backend{ server 127.0.0.1:8019;}server { listen 80; server_name 139.224.68.68;location / { root htdocs_coco; in...
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文件编写
基础教程推荐
- 在Laravel中实现使用AJAX动态刷新部分页面 2023-03-02
- php array分组,PHP中array数组的分组排序 2022-08-01
- PHP命名空间简单用法示例 2022-12-01
- PHP实现Redis单据锁以及防止并发重复写入 2022-10-12
- 使用PHP开发留言板功能 2023-03-13
- laravel ORM关联关系中的 with和whereHas用法 2023-03-02
- laravel 解决多库下的DB::transaction()事务失效问题 2023-03-08
- PHP获取MySQL执行sql语句的查询时间方法 2022-11-09
- PHP中的错误及其处理机制 2023-06-04
- thinkphp3.2.3框架动态切换多数据库的方法分析 2023-03-19