user root;
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 {
proxy_buffer_size 128k;
proxy_buffers 32 32k;
proxy_busy_buffers_size 128k;
include mime.types;
default_type application/octet-stream;
#解决nginx 出现 413 Request Entity Too Large问题,ngin默认限制1M
client_max_body_size 800m;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
charset utf-8;
gzip on;
gzip_vary on;
gzip_min_length 1k;
gzip_comp_level 9;
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";
#网关地址 /api/前端统一加前缀
location /api/ {
proxy_pass http://192.168.188.246:8080/;
}
#前端地址
location /{
add_header Cache-Control "no-cache, no-store";
root /usr/nicecloud/front/dist;
index index.html;
try_files $uri $uri/ /index.html;
}
}