2020-02-20 02:37:14 +01:00
|
|
|
server {
|
2020-02-23 20:59:26 +01:00
|
|
|
listen 443 ssl http2;
|
|
|
|
listen [::]:443 ssl http2;
|
2020-02-20 02:37:14 +01:00
|
|
|
root /var/www/MISP/app/webroot;
|
|
|
|
index index.php;
|
|
|
|
|
2020-03-20 15:14:53 +01:00
|
|
|
client_max_body_size 50M;
|
|
|
|
|
2020-02-23 20:59:26 +01:00
|
|
|
# Disable access logs
|
|
|
|
access_log off;
|
|
|
|
log_not_found off;
|
2020-02-24 19:05:07 +01:00
|
|
|
error_log /dev/stderr error;
|
2020-02-23 20:59:26 +01:00
|
|
|
|
2020-05-29 02:23:33 +02:00
|
|
|
ssl_certificate /etc/nginx/certs/cert.pem;
|
|
|
|
ssl_certificate_key /etc/nginx/certs/key.pem;
|
2020-02-23 20:59:26 +01:00
|
|
|
ssl_session_timeout 1d;
|
|
|
|
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
|
|
|
|
ssl_session_tickets off;
|
2020-05-29 01:33:54 +02:00
|
|
|
|
|
|
|
# intermediate configuration
|
2020-05-29 02:23:33 +02:00
|
|
|
ssl_dhparam /etc/nginx/certs/dhparams.pem;
|
2020-05-29 01:33:54 +02:00
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
|
|
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
|
2020-02-23 20:59:26 +01:00
|
|
|
ssl_prefer_server_ciphers off;
|
2020-02-20 02:37:14 +01:00
|
|
|
|
|
|
|
# enable HSTS
|
|
|
|
add_header Strict-Transport-Security "max-age=15768000; includeSubdomains";
|
|
|
|
add_header X-Frame-Options SAMEORIGIN;
|
|
|
|
|
2020-02-23 20:59:26 +01:00
|
|
|
# Aded headers for hardening browser security
|
2020-05-29 01:33:54 +02:00
|
|
|
add_header Referrer-Policy "no-referrer" always;
|
|
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
|
|
add_header X-Download-Options "noopen" always;
|
|
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
|
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
|
|
|
add_header X-Robots-Tag "none" always;
|
|
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
|
|
|
2020-02-23 20:59:26 +01:00
|
|
|
# Remove X-Powered-By, which is an information leak
|
|
|
|
fastcgi_hide_header X-Powered-By;
|
|
|
|
|
2020-02-20 02:37:14 +01:00
|
|
|
location / {
|
|
|
|
try_files $uri $uri/ /index.php;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~ \.php$ {
|
|
|
|
include snippets/fastcgi-php.conf;
|
|
|
|
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
|
2020-03-17 23:32:01 +01:00
|
|
|
fastcgi_read_timeout 300;
|
2020-02-20 02:37:14 +01:00
|
|
|
}
|
|
|
|
}
|