Skip to content

Commit

Permalink
security: remove server tokens, use app 404
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-herman committed Apr 1, 2024
1 parent 342f336 commit 213e983
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ http {
server {
listen 80;
server_name localhost;
server_tokens off;
charset utf-8;

root /app;
index index.html;

location ~* \.(?:css|js)$ {
try_files $uri =404;
try_files $uri /index.html;
expires 1y;
access_log off;
add_header Cache-Control "public";
}

# Any route containing a file extension (e.g. /devicesfile.js)
location ~ ^.+\..+$ {
try_files $uri =404;
try_files $uri /index.html;
}

# Any route that doesn't have a file extension (e.g. /devices)
Expand Down

0 comments on commit 213e983

Please sign in to comment.