mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-02 17:59:36 +07:00
Prevent nginx HTTP Server Detection
Signed-off-by: Jan Kiesewetter <jan@t3easy.de>
This commit is contained in:
@@ -15,6 +15,9 @@ server {
|
||||
listen [::]:80;
|
||||
server_name cloud.example.com;
|
||||
|
||||
# Prevent nginx HTTP Server Detection
|
||||
server_tokens off;
|
||||
|
||||
# Enforce HTTPS
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
@@ -32,6 +35,9 @@ server {
|
||||
ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;
|
||||
ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;
|
||||
|
||||
# Prevent nginx HTTP Server Detection
|
||||
server_tokens off;
|
||||
|
||||
# HSTS settings
|
||||
# WARNING: Only add the preload option once you read about
|
||||
# the consequences in https://hstspreload.org/. This option
|
||||
|
||||
@@ -14,6 +14,9 @@ server {
|
||||
listen [::]:80;
|
||||
server_name cloud.example.com;
|
||||
|
||||
# Prevent nginx HTTP Server Detection
|
||||
server_tokens off;
|
||||
|
||||
# Enforce HTTPS just for `/nextcloud`
|
||||
location /nextcloud {
|
||||
return 301 https://$server_name$request_uri;
|
||||
@@ -33,6 +36,9 @@ server {
|
||||
ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;
|
||||
ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;
|
||||
|
||||
# Prevent nginx HTTP Server Detection
|
||||
server_tokens off;
|
||||
|
||||
# HSTS settings
|
||||
# WARNING: Only add the preload option once you read about
|
||||
# the consequences in https://hstspreload.org/. This option
|
||||
|
||||
Reference in New Issue
Block a user