Datura-Network/5-Monitoring/local-server/nginx.conf

75 lines
2.5 KiB
Nginx Configuration File
Raw Normal View History

2024-03-05 20:03:41 +01:00
upstream monitorbackend {
#server 127.0.0.1:3009;
server 10.8.0.2:3222;
}
server {
listen 80;
listen [::]:80;
server_name monitor.nihilism.network;
return 301 https://$server_name$request_uri;
}
server {
######## TOR CHANGES ########
listen 4445;
listen [::]:4445;
server_name monitor.nihilhfjmj55gfbleupwl2ub7lvbhq4kkoioatiopahfqwkcnglsawyd.onion;
add_header Onion-Location "http://monitor.nihilhfjmj55gfbleupwl2ub7lvbhq4kkoioatiopahfqwkcnglsawyd.onion$request_uri" always;
######## TOR CHANGES ########
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name monitor.nihilism.network;
ssl_certificate /root/.acme.sh/monitor.nihilism.network/fullchain.cer;
ssl_certificate_key /root/.acme.sh/monitor.nihilism.network/monitor.nihilism.network.key;
########################################## HARDENING SSL #############################################
ssl_dhparam /root/.acme.sh/dhparam.pem;
# SSL Settings
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;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_session_tickets off;
ssl_ecdh_curve auto;
# OCSP stapling
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /root/.acme.sh/monitor.nihilism.network/fullchain.cer;
resolver 1.1.1.1 208.67.222.222;
add_header Strict-Transport-Security "max-age=63072000" always;
access_log off;
error_log off;
###################################END OF HARDENING SSL###########################################
#apt install apache2-utils -y
#htpasswd -c /etc/nginx/auth/default.htpasswd nothing
auth_basic "Password protection";
auth_basic_user_file /etc/nginx/auth/default.htpasswd;
location / {
proxy_pass http://monitorbackend;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
client_max_body_size 20G;
}
}