server {
listen 80;
server_name _;
#将请求转成https
#rewrite ^(.*)$ https://$host$1 permanent;
gzip on;
gzip_static on; # 需要http_gzip_static_module 模块
gzip_min_length 1k;
gzip_comp_level 4;
gzip_proxied any;
gzip_types text/plain text/xml text/css;
gzip_vary on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
client_max_body_size 8M;#(配置请求体缓存区大小, 不配的话)
client_body_buffer_size 128k;#(设置客户端请求体最大值)
fastcgi_intercept_errors on;
# 若新增后端路由前缀注意在此处添加(|新增)
location ~* ^/(code|auth|admin|monitor|gen|job|tx|act|mp|pay|base|help|ih|cons|mall|invoice) {
proxy_pass http://pigx-gateway:9999;
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
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 http;
}
location / {
root /usr/share/nginx/html/cons/;
index index.html index.html;
}
location /fpweb {
alias /usr/share/nginx/html/invoice-web/;
index index.html;
}
# 避免端点安全问题
if ($request_uri ~ "/actuator"){
return 403;
}
}
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
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 /var/log/nginx/access.log main;
client_max_body_size 300m;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 4096;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
}