#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
error_log logs/error.log error;
pid logs/httpserver.pid;
events {
worker_connections 1024;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
status_zone;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 60;
#gzip on;
server {
listen 8080;
server_name localhost;
#charset koi8-r;
access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#server status
location /api {
access_log off;
api write=off;
status_bypass on;
allow 127.0.0.1;
deny all;
}
#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;
}
# 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 html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with httpserver's one
#
#location ~ /\.ht {
# deny all;
#}
}
# HTTPS server
#server {
#listen 443 ssl;
#server_name localhost;
#ssl_protocols TLSv1.2 TLSv1.3 GMTLSv1.1;
#GMTLS key
#ssl_certificate crt/SS.pem;
#ssl_certificate_key crt/SS.key.pem;
#ssl_certificate crt/SE.pem;
#ssl_certificate_key crt/SE.key.pem;
#https key
#ssl_certificate crt/common_cert/server.crt;
#ssl_certificate_key crt/common_cert/server.key;
#ssl_session_cache shared:SSL:1m;
#ssl_session_timeout 5m;
#ssl_ciphers HIGH:!aNULL:!MD5;
#ssl_prefer_server_ciphers on;
#location / {
#root html;
#index index.html index.htm;
#}
#}
server {
listen 8081;
server_name local.mzh.tong;
root /home/liubang/桌面/THS/html/v2.app.mzhjs.com/www;
location /keeper {
alias /home/liubang/桌面/THS/html/v2.app.mzhjs.com/www/backend/web;
rewrite ^(/keeper)/$ $1 permanent;
try_files $uri /backend/web/index.php?$args;
}
location ~ ^/keeper/(.+\.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar|ttf|woff|woff2|ico))$ {
rewrite ^/keeper/(.+)$ /backend/web/$1 break;
rewrite ^/keeper/(.+)/(.+)$ /backend/web/$1/$2 break;
try_files $uri =404;
}
location / {
root /home/liubang/桌面/THS/html/v2.app.mzhjs.com/www/api/web;
# nginx ignore index.php
try_files $uri /api/web/index.php?$args;
}
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar|ttf|woff|woff2|ico)$ {
access_log off;
expires 360d;
try_files $uri /api/web/$uri =404;
}
location ~ \.php(.*)$ {
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;
}
}
}
~~
网友评论