64 lines
2.0 KiB
Plaintext
64 lines
2.0 KiB
Plaintext
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
if ($scheme = "http") {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
if ($http_x_forwarded_proto = "http") {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
listen 443 ssl http2;
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
|
|
client_max_body_size 0;
|
|
client_body_buffer_size 512k;
|
|
proxy_read_timeout 86400s;
|
|
|
|
server_name nextcloud.aldon.fr;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/aldon.fr/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/aldon.fr/privkey.pem;
|
|
|
|
ssl_dhparam "/etc/dhparam";
|
|
|
|
ssl_early_data on;
|
|
ssl_session_cache shared:SSL:10m;
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ecdh_curve x25519:x448:secp521r1:secp256r1;
|
|
|
|
ssl_prefer_server_ciphers on;
|
|
ssl_conf_command Options PrioritizeChaCha;
|
|
ssl_ciphers TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305-ECDHE-ECSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:RCDHE-RSA-AES128-GCM-SHA256;
|
|
|
|
location / {
|
|
proxy_pass http://192.168.1.30:11000$request_uri;
|
|
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-REAL-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
proxy_set_header X-Forwarded-Scheme $scheme;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Early-Data $ssl_early_data;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
# Error pages
|
|
error_page 502 /502.html;
|
|
location /502.html {
|
|
root /var/www/html;
|
|
}
|
|
}
|
|
|
|
} |