Uningnore and track conf files
This commit is contained in:
95
data/conf.d/hugo.conf
Normal file
95
data/conf.d/hugo.conf
Normal file
@@ -0,0 +1,95 @@
|
||||
# # Redirect HTTP to HTTPS
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name novicelab.io www.novicelab.io;
|
||||
|
||||
# ACME challenge for Let's Encrypt certificate renewal
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl; #http2;
|
||||
listen [::]:443 ssl; # http2;
|
||||
server_name novicelab.io www.novicelab.io;
|
||||
|
||||
# SSL Certificate paths
|
||||
ssl_certificate /etc/letsencrypt/live/novicelab.io/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/novicelab.io/privkey.pem;
|
||||
|
||||
# Trusted certificate for OCSP stapling
|
||||
# ssl_trusted_certificate /etc/nginx/ssl/chain.pem;
|
||||
|
||||
# Cloudflare Origin CA certificate for client verification
|
||||
# Cloudflare Origin CA for authenticated origin pulls (optional)
|
||||
# Only enable if you want to restrict to Cloudflare only
|
||||
# ssl_client_certificate /etc/nginx/ssl/client-cert.pem;
|
||||
# ssl_verify_client on;
|
||||
|
||||
# SSL Protocol - TLS 1.2 and 1.3 only
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
|
||||
# Cipher suites (prioritize TLS 1.3, secure TLS 1.2 fallback)
|
||||
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 off;
|
||||
|
||||
# SSL session configuration
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_tickets off;
|
||||
|
||||
# OCSP Stapling
|
||||
# ssl_stapling on;
|
||||
# ssl_stapling_verify on;
|
||||
resolver 127.0.0.11 8.8.8.8 8.8.4.4 valid=300s;
|
||||
resolver_timeout 5s;
|
||||
|
||||
# Security Headers
|
||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Content-Security-Policy "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval';" always;
|
||||
|
||||
# Diffie-Hellman parameter for DHE ciphersuites
|
||||
# ssl_dhparam /etc/nginx/ssl/dhparam.pem;
|
||||
|
||||
# Logging
|
||||
access_log /var/log/nginx/example.com_access.log;
|
||||
error_log /var/log/nginx/example.com_error.log;
|
||||
|
||||
# Root and index
|
||||
# root /var/www/html;
|
||||
# index index.html index.htm;
|
||||
|
||||
# Only allow traffic from Cloudflare IPs (optional but recommended)
|
||||
# include /etc/nginx/cloudflare-ips.conf;
|
||||
|
||||
# include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
set $hugo_backend hugo:1313;
|
||||
|
||||
location / {
|
||||
# proxy_pass http://10.0.0.251:9200/;
|
||||
proxy_pass http://$hugo_backend;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
# proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Real-IP $http_cf_connecting_ip;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https; # $scheme;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_set_header Referer $http_referer;
|
||||
proxy_redirect off;
|
||||
|
||||
proxy_set_header Cookie $http_cookie;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user