server { listen 8080 default_server; listen [::]:8080 default_server; root /usr/share/nginx/html; index index.html index.htm index.nginx-debian.html; server_name _; location / { try_files $uri/index.html $uri $uri/ /index.html; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html/; internal; } location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { expires 1M; access_log off; add_header Cache-Control "public"; } location ~* \.(?:css|js)$ { try_files $uri =404; expires 1y; access_log off; add_header Cache-Control "public"; } }