From 0399fa085e653b55efe06ce5e8b388cfa98cc1f4 Mon Sep 17 00:00:00 2001 From: Samuel ORTION Date: Sat, 13 Aug 2022 12:44:01 +0200 Subject: [PATCH] Add ssl conf --- www/nginx.conf | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/www/nginx.conf b/www/nginx.conf index fda2b40..5661aa7 100644 --- a/www/nginx.conf +++ b/www/nginx.conf @@ -3,19 +3,33 @@ server { server_name birdnet.example.com; root /var/www/html; - access_log /var/log/nginx/birdnet/birdnet-access.log; - error_log /var/log/nginx/birdnet/birdnet-error.log error; + location / { + return 302 https://$host$request_uri; + } + +} + +server { + listen 443 ssl; + server_name birdnet.example.com; + root /var/www/html; + ssl on; + ssl_certificate /etc/nginx/ssl/birdnet.crt; + ssl_certificate_key /etc/nginx/ssl/birdnet.key; index index.html index.htm index.php; location / { - try_files $uri $uri/ /index.php$is_args$args; - } + try_files $uri $uri/ /index.php$is_args$args; + } - location ~ \.php$ { + location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php-fpm/www.sock; fastcgi_index index.php; include fastcgi.conf; - } -} + } + + access_log /var/log/nginx/birdnet/birdnet-access.log; + error_log /var/log/nginx/birdnet/birdnet-error.log error; +} \ No newline at end of file