Skip to content

Instantly share code, notes, and snippets.

@mttaggart
Created June 1, 2022 19:05
Show Gist options
  • Save mttaggart/dfe9579cf2328f69f8d9727fb0bd4b31 to your computer and use it in GitHub Desktop.
Save mttaggart/dfe9579cf2328f69f8d9727fb0bd4b31 to your computer and use it in GitHub Desktop.
Basic Docker Nginx HTTPS config
# Generated by nginxconfig.io
# https://www.serverion.com/nginx-config/#?0.redirect=false&0.http2=false&0.hsts=false&0.cert_type=custom&0.php=false&0.index=index.html&resolver_cloudflare=false&resolver_google=false&resolver_opendns=false&file_structure=unified
user www-data;
pid /run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 65535;
events {
multi_accept on;
worker_connections 65535;
}
http {
charset utf-8;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
log_not_found off;
types_hash_max_size 2048;
client_max_body_size 16M;
# MIME
include mime.types;
default_type application/octet-stream;
# logging
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log warn;
# SSL
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
# Diffie-Hellman parameter for DHE ciphersuites
#ssl_dhparam /etc/nginx/dhparam.pem;
# Mozilla Intermediate configuration
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;
# OCSP Stapling
#ssl_stapling on;
#ssl_stapling_verify on;
# load configs
include /etc/nginx/conf.d/*.conf;
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name myserver;
root /usr/share/nginx/html;
# SSL
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
}
# HTTP redirect
server {
listen 80;
listen [::]:80;
server_name anduril;
return 301 https://myserver$request_uri;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment