You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
118 lines
3.2 KiB
118 lines
3.2 KiB
|
|
#user nobody;
|
|
worker_processes 1;
|
|
|
|
#error_log logs/error.log;
|
|
#error_log logs/error.log notice;
|
|
#error_log logs/error.log info;
|
|
|
|
#pid logs/nginx.pid;
|
|
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
|
|
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;
|
|
|
|
add_header Content-Security-Policy "upgrade-insecure-requests";
|
|
|
|
sendfile on;
|
|
#tcp_nopush on;
|
|
|
|
#keepalive_timeout 0;
|
|
keepalive_timeout 65s;
|
|
|
|
client_max_body_size 500m; # 设置客户端请求的最大大小
|
|
client_body_buffer_size 500m; # 设置客户端请求的缓冲区大小
|
|
|
|
proxy_read_timeout 7200s; # 设置代理服务器读取客户端请求的超时时间
|
|
|
|
gzip on; # 开启gzip压缩
|
|
gzip_vary on; # 根据请求头中的Accept-Encoding启用Vary响应头
|
|
gzip_proxied any; # 无论请求是否已经压缩,都进行压缩
|
|
gzip_comp_level 5; # 压缩级别,1-9,9最快但消耗更多CPU资源
|
|
gzip_min_length 256; # 只压缩大于256字节的响应
|
|
gzip_types text/plain text/css text/xml application/json application/javascript application/x-javascript; # 压缩的MIME类型
|
|
gzip_disable "MSIE6"; # 针对IE6禁用gzip
|
|
|
|
|
|
server {
|
|
listen 3831;
|
|
server_name 127.0.0.1;
|
|
|
|
# 跨域配置 start
|
|
add_header Access-Control-Allow-Origin *;
|
|
add_header Cache-Control "no-cache, no-store";
|
|
|
|
# 限制外网访问内网 actuator 相关路径
|
|
location ~ ^(/[^/]*)?/actuator(/.*)?$ {
|
|
return 403;
|
|
}
|
|
|
|
location / {
|
|
root ./path/analysis-system; # 相对于nginx安装目录的相对路径
|
|
index index.html index.htm;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location /prod-api/ {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header REMOTE-HOST $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_pass http://127.0.0.1:8089/;
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root html;
|
|
}
|
|
}
|
|
|
|
|
|
# another virtual host using mix of IP-, name-, and port-based configuration
|
|
#
|
|
#server {
|
|
# listen 8000;
|
|
# listen somename:8080;
|
|
# server_name somename alias another.alias;
|
|
|
|
# location / {
|
|
# root html;
|
|
# index index.html index.htm;
|
|
# }
|
|
#}
|
|
|
|
|
|
# HTTPS server
|
|
#
|
|
#server {
|
|
# listen 443 ssl;
|
|
# server_name localhost;
|
|
|
|
# ssl_certificate cert.pem;
|
|
# ssl_certificate_key cert.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;
|
|
# }
|
|
#}
|
|
|
|
}
|