mirror of
https://github.com/2martens/cloud-configuration.git
synced 2026-10-17 16:46:51 +02:00
31 lines
846 B
Nginx Configuration File
31 lines
846 B
Nginx Configuration File
user nginx;
|
|
worker_processes auto;
|
|
events { worker_connections 1024; }
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
access_log /var/log/nginx/access.log;
|
|
error_log /var/log/nginx/error.log;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
# HTTP -> HTTPS redirect
|
|
server {
|
|
listen 80;
|
|
server_name api.2martens.de;
|
|
location /.well-known/acme-challenge/ { root /var/www/certbot; }
|
|
location / { return 301 https://$host$request_uri; }
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name api.2martens.de;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/api.2martens.de/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/api.2martens.de/privkey.pem;
|
|
|
|
include /etc/nginx/paths-enabled.d/*.conf;
|
|
|
|
location / { return 404; }
|
|
}
|
|
} |