server { listen 8006; server_name localhost; gzip on; gzip_min_length 5k; gzip_buffers 4 16k; gzip_comp_level 3; gzip_types text/plain application/javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; gzip_vary on; location /api { proxy_pass http://114.116.150.249:61002; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location ~ .*\.(?:html)$ { add_header Cache-Control "no-cache"; root /usr/share/nginx/html/dist/web; index index.html; try_files $uri /index.html; } location ~.*\.(?:jpg|jpeg|js|css|svg|ttf|png){ add_header expires 30d; root /usr/share/nginx/html/dist/web; } location / { root /usr/share/nginx/html/dist/web; index index.html; try_files $uri /index.html; } }