diff --git a/Website/etc/nginx/default.conf b/Website/etc/nginx/default.conf index aaf83ab..e55a0b6 100644 --- a/Website/etc/nginx/default.conf +++ b/Website/etc/nginx/default.conf @@ -1,14 +1,23 @@ # Nginx configuration +server_tokens off; +add_header X-XSS-Protection "1; mode=block"; +add_header X-Content-Type-Options nosniff; + server { listen 80 default_server; listen [::]:80 default_server; + gzip on; + gzip_static on; + gzip_vary on; + gzip_http_version 1.1; + gzip_min_length 700; + gzip_comp_level 6; server_name localhost; - - index index.php index.html; error_log /var/log/nginx/error.log; access_log /var/log/nginx/access.log; root /var/www/html/public; + index index.php index.html index.htm; location ~ \.php$ { try_files $uri =404; @@ -19,6 +28,68 @@ server { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } + + location ~ /\.ht { + deny all; + } + + location /downloads { + autoindex on; + autoindex_exact_size off; + } + + location /board { + index index.php index.html index.htm; + try_files $uri $uri/ @rewriteapp; + } + + location @rewriteapp { + rewrite ^(.*)$ /app.php/$1 last; + } + + # Deny access to internal phpbb files. + location ~ /board(config\.php|common\.php|files|images/avatars/upload|includes|(?