load_module modules/ngx_http_image_filter_module.so;
user root;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/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 /var/log/nginx/access.log main;
client_max_body_size 200m;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
proxy_cache_path ./web_cache levels=1:2 keys_zone=web_cache:1024m inactive=1m max_size=1g;
upstream cwbase {
server 172.18.231.224:3000 weight=10 max_fails=3 fail_timeout=30s;
}
upstream xmysql {
server 172.18.231.224:3000 weight=10 max_fails=3 fail_timeout=30s;
}
upstream fileview {
#server 172.18.231.224:30000 weight=10 max_fails=3 fail_timeout=30;
server 172.18.231.224:30001 weight=10 max_fails=3 fail_timeout=30;
server 172.18.231.224:30002 weight=10 max_fails=3 fail_timeout=30;
}
upstream jeecg-api {
#server 172.18.231.224:8080 weight=10 max_fails=3 fail_timeout=30;
server 172.18.231.224:8082 weight=10 max_fails=3 fail_timeout=30;
#server 172.18.201.235:10000 weight=10 max_fails=3 fail_timeout=30;
#server 172.18.201.235:10002 weight=10 max_fails=3 fail_timeout=30;
}
server {
listen 80;
listen 443 ssl;
server_name www.shengtai.club;
ssl_certificate /cert/www.shengtai.club.pem;
ssl_certificate_key /cert/www.shengtai.club.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
root /usr/share/nginx/html;
gzip on;
gzip_min_length 1k;
gzip_comp_level 1;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
gzip_buffers 32 4k;
gzip_http_version 1.0;
error_page 400 = /400.html;
error_page 401 = /401.html;
error_page 402 = /402.html;
error_page 403 = /403.html;
error_page 404 = /404.html;
error_page 500 = /500.html;
error_page 501 = /501.html;
error_page 502 = /502.html;
error_page 503 = /503.html;
error_page 520 = /520.html;
error_page 521 = /521.html;
error_page 533 = /533.html;
location ^~ /api {
rewrite ^/(.*) /$1 break;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://cwbase/;
}
location ^~ /apis/ {
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';
proxy_redirect off;