|
以下是nginx配置文件,以前也一直是在这里面添加东西的,升级到2017以后发现不行了。。。
#user nobody;
worker_processes 1;
worker_rlimit_nofile 10240;
#error_log ../logs/nginx_error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 10240;
# accept_mutex off;
}
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 on;
server_tokens off;
sendfile on;
#tcp_nopush on;
tcp_nodelay on;
#keepalive_timeout 0;
keepalive_timeout 65;
keepalive_requests 100;
client_max_body_size 2000m;
client_header_buffer_size 128k;
client_body_buffer_size 256k;
fastcgi_buffer_size 64k;
fastcgi_buffers 32 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 512k;
fastcgi_connect_timeout 60s;
fastcgi_read_timeout 1800s;
fastcgi_send_timeout 1800s;
fastcgi_intercept_errors off;
#open_file_cache max=10000 inactive=3600s;
#open_file_cache_valid 300s;
#open_file_cache_min_uses 1;
#open_file_cache_errors on;
gzip on;
gzip_comp_level 9;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_types text/plain application/json application/x-javascript application/javascript text/css text/xml image/jpeg image/png image/gif;
gzip_vary on;
gzip_static on;
gzip_proxied any;
gzip_disable "MSIE [1-6]\.";
upstream OfficeFPM{
server 127.0.0.1:8266 weight=1;
keepalive 100;
}
# HTTP server
server {
#Nginx Port
listen 80;
server_name oa.xxx.com;
root D:/MYOA/webroot/;
index index.php index.html index.htm;
if (-d $request_filename){
rewrite ^/(.*)([^/])$ $scheme://$http_host/$1$2/ permanent;
}
#charset gbk;
access_log logs/oa.access.log main;
error_log logs/oa.error.log;
location ~* ^/(attachment|static|images|theme|templates|wav)/.*\.(php|.php3|.php5|jsp|asp)$ {
deny all;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:8266
#
location ~ \.php$ {
fastcgi_pass OfficeFPM;
fastcgi_index index.php;
include fastcgi.conf;
}
location /general/document/index.php/ {
fastcgi_pass OfficeFPM;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME D:/MYOA/webroot/general/document/index.php;
fastcgi_param SCRIPT_NAME /general/document/index.php;
fastcgi_split_path_info ^(.+\.php)/(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
location /general/itask/router.php/ {
fastcgi_pass OfficeFPM;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME D:/MYOA/webroot/general/itask/router.php;
fastcgi_param SCRIPT_NAME /general/itask/router.php;
}
location /general/appbuilder/ {
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
rewrite ^/general/appbuilder/(.*)$ /general/appbuilder/web/index.php?$args;
}
location ~* \.(eot|otf|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
}
include common.conf;
location ~* ^/attachment/(background|im|new_sms|reportshop|cache|data_center|appbuilder) {
allow all;
}
location /attachment {
deny all;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
rewrite ^/restapi/ /restapi/public/app.php;
rewrite ^/oauth2/ /restapi/public/app.php;
location ~ ^/tdngstat/ {
stub_status on;
access_log off;
}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
# Redirect server
#server {
# #Redirect Port
# listen 80;
# server_name localhost;
#
# if ($request_method != POST){
# return 301 https://$server_name$request_uri;
# }
#
# return 307 https://$server_name$request_uri;
#}
# HTTPS server
server {
#Https Port
listen 443;
server_name oa.xxxcom;
root D:/MYOA/webroot/;
index index.php index.html index.htm;
access_log logs/oa_ssl.access.log main;
error_log logs/oa_ssl.error.log;
ssl on;
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_prefer_server_ciphers on;
if (-d $request_filename){
rewrite ^/(.*)([^/])$ $scheme://$http_host/$1$2/ permanent;
}
location ~* ^/(attachment|static|images|theme|templates|wav)/.*\.(php|.php3|.php5|jsp|asp)$ {
deny all;
}
location ~ \.php$ {
fastcgi_pass OfficeFPM;
fastcgi_index index.php;
include fastcgi.conf;
}
location /general/document/index.php/ {
fastcgi_pass OfficeFPM;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME D:/MYOA/webroot/general/document/index.php;
fastcgi_param SCRIPT_NAME /general/document/index.php;
fastcgi_split_path_info ^(.+\.php)/(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
location /general/appbuilder/ {
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
rewrite ^/general/appbuilder/(.*)$ /general/appbuilder/web/index.php?$args;
}
location /general/itask/router.php/ {
fastcgi_pass OfficeFPM;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME D:/MYOA/webroot/general/itask/router.php;
fastcgi_param SCRIPT_NAME /general/itask/router.php;
}
include common.conf;
location ~* ^/attachment/(background|im|new_sms|reportshop|cache|data_center|appbuilder) {
allow all;
}
location /attachment {
deny all;
}
rewrite ^/restapi/ /restapi/public/app.php;
rewrite ^/oauth2/ /restapi/public/app.php;
}
#Queue OfficeFPM
upstream OfficeFPMQueue{
server 127.0.0.1:8250 weight=1;
keepalive 100;
}
# Queue HTTP server
server {
#Queue Port
listen 8750;
server_name localhost;
root D:/MYOA/webroot/;
index index.php;
if (-d $request_filename){
rewrite ^/(.*)([^/])$ $scheme://$http_host/$1$2/ permanent;
}
#charset gbk;
access_log logs/oa_queue.access.log main;
error_log logs/oa_queue.error.log;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:8250
#
location ~ \.php$ {
fastcgi_pass OfficeFPMQueue;
fastcgi_index index.php;
include fastcgi.conf;
}
location / {
allow 127.0.0.1;
deny all;
}
location ~ ^/tdngstatqueue/ {
stub_status on;
access_log off;
}
}
}
|
|