diff --git a/nginx.conf b/nginx.conf index 2d14b2f..61dd4de 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,11 +1,26 @@ -server { - listen 80 default_server; +worker_processes 4; - root /usr/share/nginx/html; +events { + worker_connections 1024; +} - index index.html; +http { + server { + listen 80; + server_name YOUR_SERVER_NAME; + charset utf-8; + root /usr/share/nginx/html; + index index.html; - location / { - try_files $uri /index.html =404; - } -} + #Always serve index.html for any request + location / { + try_files $uri /index.html; + include /etc/nginx/mime.types; <- this fixed my problem with css being read as `text/plain` mimetype + } + error_log /var/log/nginx/client-error.log; + access_log /var/log/nginx/client-access.log; + + server_tokens off; + add_header X-Content-Type-Options nosniff; + } +} \ No newline at end of file