server { listen 80; server_name localhost; # access_log /var/log/nginx/host.access.log main; gzip on; gzip_vary on; gzip_comp_level 4; gzip_min_length 256; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; location / { root /usr/share/nginx/html; index index.html index.htm; } location ~ assets\/.*\.(?:css|js|woff2?|svg|gif|map)$ { root /usr/share/nginx/html; try_files $uri $uri/ /index.html; add_header Cache-Control "public, max-age=31536000, immutable"; # access_log off; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }