nginx.conf
#user nobody;
worker_processes? 4;
worker_rlimit_nofile 8192;
#error_log? logs/error_log? debug;
error_log? /home/work/phpenv/log/error_log? notice;
pid? ? ? ? /home/work/phpenv/var/nginx.pid;
events {
? ? use epoll;
? ? worker_connections? 8192;
}
http {
? ? include? ? ? mime.types;
? ? default_type? application/octet-stream;
? ? ignore_invalid_headers? off;
? ? log_format? main? '$remote_addr - $remote_user [$time_local] "$request" '
? ? ? ? ? ? '$status $body_bytes_sent "$http_referer" "$http_cookie" "$http_user_agent" '
? ? ? ? ? ? '$request_time $http_x_bd_logid $http_x_bd_routerip $server_addr $upstream_addr $host '
? ? ? ? ? ? '"$http_x_forwarded_for" $product $subsys $tracecode $msec';
? ? access_log? "/home/work/phpenv/log/access_log"? main;
? ? client_body_temp_path /home/work/phpenv/webserver/cache/client_body;
? ? fastcgi_temp_path /home/work/phpenv/webserver/cache/fastcgi;
? ? proxy_temp_path /home/work/phpenv/webserver/cache/proxy;
? ? uwsgi_temp_path /home/work/phpenv/webserver/cache/uwsgi;
? ? scgi_temp_path /home/work/phpenv/webserver/cache/scgi;
? ? server_names_hash_bucket_size 128;
? ? client_header_buffer_size 4k;
? ? large_client_header_buffers 4 32k;
? ? client_max_body_size 4m;
? ? client_body_buffer_size 513k;
? ? client_body_timeout 15;
? ? client_header_timeout 10;
? ? send_timeout 240;
? ? sendfile? ? ? ? on;
? ? tcp_nopush? ? ? on;
? ? tcp_nodelay? ? on;
? ? fastcgi_connect_timeout 5;
? ? fastcgi_send_timeout 10;
? ? fastcgi_read_timeout 10;
? ? fastcgi_buffer_size 64k;
? ? fastcgi_buffers 4 64k;
? ? fastcgi_busy_buffers_size 128k;
? ? fastcgi_temp_file_write_size 128k;
? ? fastcgi_intercept_errors on;
? ? keepalive_timeout? 0;
? ? #keepalive_timeout? 65;
? ? gzip on;
? ? gzip_min_length 10k;
? ? gzip_buffers 4 16k;
? ? gzip_http_version 1.1;
? ? gzip_comp_level 2;
? ? gzip_types text/plain application/x-javascript text/css application/xml;
? ? gzip_vary on;
? ? policy_frame off;
? ? policy_path "/home/work/phpenv/webserver/conf/";
? ? policy_dtdname policy.dtd;
? ? policy_docname policy.xml;
? ? policy_logpath "/home/work/phpenv/log/webserver";
? ? policy_logfile policy.;
? ? policy_logsize 1600;
? ? policy_loglevel 16;
? ? proxy_connect_timeout 15s;
? ? proxy_read_timeout 24s;
? ? proxy_send_timeout 10s;
? ? proxy_buffer_size 64k;
? ? proxy_buffers 4 64k;
? ? proxy_busy_buffers_size 128k;
? ? proxy_temp_file_write_size 128k;
? ? proxy_set_header LOGID $logid;
? ? proxy_set_header Host $http_host;
#? charset GBK;
? ? uninitialized_variable_warn off;
? ? set_real_ip_from 10.0.0.0/8;
? ? real_ip_header CLIENTIP;
? ? #include vhost/xx_443.conf;
? ? #include vhost/xx_st_443.conf;
? ? include vhost/*.conf;
}
443.conf
server {
? ? listen? ? ? ? ? ? ? 443;
? ? ssl on;
? ? ssl_certificate_key ../cert/cert-1540539153804_.key;
? ? ssl_certificate? ? ../cert/cert-1540539153804_.crt;
? ? server_name? ? ? ? _;
? ? more_set_headers? ? 'Server: Apache';
? ? set $php_upstream 'unix:/home/work/phpenv/var/php-cgi.sock';
? ? #set $php_upstream 'unix:/home/work/phpenv/var/hhvm.sock';
? ? #set $php_upstream 'unix:/home/work/phpenv/var/phaster.hhvm.sock';
#########域名適配模塊配置###############
? ? dna off;
? ? dna_adapt_path "/home/work/phpenv/webserver/conf/adaption";
? ? dna_url_adaption "device";
? ? dna_cookie_adaption "device";
#########OMP支持#######################
? ? #設(shè)置產(chǎn)品線
? ? set $product odp;
? ? #設(shè)置子系統(tǒng)
? ? set $subsys odp;
? ? if ($http_x_bd_product) {
? ? ? ? #從接入層獲取產(chǎn)品線
? ? ? ? set $product $http_x_bd_product;
? ? }
? ? if ($http_x_bd_subsys) {
? ? ? ? #從接入層獲取子系統(tǒng)
? ? ? ? set $subsys $http_x_bd_subsys;
? ? }
? ? underscores_in_headers on;
? ? logid_name x_bd_logid;
#? 防盜鏈
? ? if ($host !~ "^((.*\.)?(xx\.(com|com\.cn|cn)|xx\.com)|localhost|\d{1,3}(\.\d{1,3}){3})(:\d+)?$") {
? ? ? ? return 403;
? ? }
? ? location ~* /(\.svn|CVS|Entries){
? ? ? ? deny all;
? ? }
? ? location ~* /((.*)\.(.*)\/(.*)\.php){
? ? ? ? deny all;
? ? }
? ? location ~* /\.(sql|bak|inc|old)$ {
? ? ? ? deny all;
? ? }
? ? location ~ ^/(favicon.ico|static) {
? ? ? ? root? ? ? ? ? ? /home/work/phpenv/webroot;
? ? }
#? ? location ~ \.php$ {
#? ? ? ? root? ? ? ? ? ? /home/work/phpenv/webroot;
#? ? ? ? fastcgi_pass? ? $php_upstream;
#? ? ? ? fastcgi_index? index.php;
#? ? ? ? include? ? ? ? fastcgi.conf;
#? ? }
? ? location / {
? ? ? ? root /home/work/phpenv/webroot;
? ? ? ? index index.php;
? ? ? ? fastcgi_pass? ? $php_upstream;
? ? ? ? include? ? ? ? fastcgi.conf;
? ? ? ? #include? ? ? ? dispatch.conf;
? ? ? ? #rewrite ^/((\?.*)?)$ /static/index.html break;
? ? ? ? proxy_set_header Host $host;
? ? ? ? proxy_set_header X-Real-IP $remote_addr;
? ? ? ? proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
? ? ? ? rewrite ^/((\?.*)?)$ /home/index.php$1 break;
? ? ? ? rewrite ^/([^/.]*)(/[^\?]*)?((\?.*)?)$ /$1/index.php$2$3 break;
? ? }
}
server {
? ? listen? ? ? ? ? ? ? 80;
? ? server_name? ? ? ? _;
? ? more_set_headers? ? 'Server: Apache';
? ? set $php_upstream 'unix:/home/work/phpenv/var/php-cgi.sock';
? ? #set $php_upstream 'unix:/home/work/phpenv/var/hhvm.sock';
? ? #set $php_upstream 'unix:/home/work/phpenv/var/phaster.hhvm.sock';
#########域名適配模塊配置###############
? ? dna off;
? ? dna_adapt_path "/home/work/phpenv/webserver/conf/adaption";
? ? dna_url_adaption "device";
? ? dna_cookie_adaption "device";
#########OMP支持#######################
? ? #設(shè)置產(chǎn)品線
? ? set $product odp;
? ? #設(shè)置子系統(tǒng)
? ? set $subsys odp;
? ? if ($http_x_bd_product) {
? ? ? ? #從接入層獲取產(chǎn)品線
? ? ? ? set $product $http_x_bd_product;
? ? }
? ? if ($http_x_bd_subsys) {
? ? ? ? #從接入層獲取子系統(tǒng)
? ? ? ? set $subsys $http_x_bd_subsys;
? ? }
? ? underscores_in_headers on;
? ? logid_name x_bd_logid;
#? 防盜鏈
? ? if ($host !~ "^((.*\.)?(xx\.(com|com\.cn|cn)|xx\.com)|localhost|\d{1,3}(\.\d{1,3}){3})(:\d+)?$") {
? ? ? ? return 403;
? ? }
? ? location ~* /(\.svn|CVS|Entries){
? ? ? ? deny all;
? ? }
? ? location ~* /((.*)\.(.*)\/(.*)\.php){
? ? ? ? deny all;
? ? }
? ? location ~* /\.(sql|bak|inc|old)$ {
? ? ? ? deny all;
? ? }
? ? location ~ ^/(favicon.ico|static) {
? ? ? ? root? ? ? ? ? ? /home/work/phpenv/webroot;
? ? }
#? ? location ~ \.php$ {
#? ? ? ? root? ? ? ? ? ? /home/work/phpenv/webroot;
#? ? ? ? fastcgi_pass? ? $php_upstream;
#? ? ? ? fastcgi_index? index.php;
#? ? ? ? include? ? ? ? fastcgi.conf;
#? ? }
? ? location / {
? ? ? ? root /home/work/phpenv/webroot;
? ? ? ? index index.php;
? ? ? ? fastcgi_pass? ? $php_upstream;
? ? ? ? include? ? ? ? fastcgi.conf;
? ? ? ? rewrite ^(.*)$? https://$host$1 permanent;
? ? }
}
tp5.conf
server {
listen? ? ? 8081;
server_name? _;
? ? ? ? root? /home/work/phpenv/webroot/fe-pc-admin/public;
? ? ? ? index? index.php;
? ? ? ? #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? html;
? ? ? ? }
? ? ? ? location / {
? ? ? ? ? ? try_files $uri @rewrite;
? ? ? ? }
? ? ? ? location @rewrite {
? ? ? ? ? ? set $static 0;
? ? ? ? ? ? if? ($uri ~ \.(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css\.map|min\.map)$) {
? ? ? ? ? ? ? ? set $static 1;
? ? ? ? ? ? }
? ? ? ? ? ? if ($static = 0) {
? ? ? ? ? ? ? ? rewrite ^/(.*)$ /index.php?s=/$1;
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? location ~ \.php(.*)$ {
? ? ? ? ? ? ? ? fastcgi_pass? ? unix:/home/work/phpenv/var/php-cgi.sock;
? ? ? ? ? ? ? ? fastcgi_index? index.php;
? ? ? ? ? ? ? ? include? ? ? ? fastcgi.conf;
? ? ? ? }
}
443.conf
server {
? ? listen? ? ? ? ? ? ? 443;
? ? server_name? ? ? ? _;
? ? ssl on;
? ? ssl_certificate_key ../cert/cert-1540548168080_xx.key;
? ? ssl_certificate? ? ../cert/cert-1540548168080_xx.crt;
? ? more_set_headers? ? 'Server: Apache';
? ? root /home/work/phpenv/webroot/static;
? ? #防盜鏈
? ? if ($host !~ "^((.*\.)?(xx\.com|xx\.com)|localhost|\d{1,3}(\.\d{1,3}){3})(:\d+)?$") {
? ? ? ? return 403;
? ? }
? ? location ~* /(\.svn|CVS|Entries){
? ? ? ? deny all;
? ? }
? ? location ~* /((.*)\.(.*)\/(.*)\.php){
? ? ? ? deny all;
? ? }
? ? location ~* /\.(sql|bak|inc|old)$ {
? ? ? ? deny all;
? ? }
? ? location ~* /\.(js|css|png|jpg|gif|svg|jpeg|html)$ {
? ? ? ? expires 12h;
? ? ? ? root /home/work/phpenv/webroot/static;
? ? ? ? access_log? off;
? ? }
}
phpinfo.conf
server {
? ? ? ? listen? ? ? 8001;
? ? ? ? server_name? _ 47.105.158.0;
? ? ? ? root? /home/work/phpinfo;
? ? ? ? index? index.php;
? ? ? ? #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? html;
? ? ? ? }
? ? ? ? location ~ \.php(.*)$ {
? ? ? ? ? ? ? ? fastcgi_pass? ? unix:/home/work/phpenv/var/php-cgi.sock;
? ? ? ? ? ? ? ? fastcgi_index? index.php;
? ? ? ? ? ? ? ? include? ? ? ? fastcgi.conf;
? ? ? ? }
}