diff options
Diffstat (limited to 'nginx.conf')
-rw-r--r-- | nginx.conf | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..ac87562 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,49 @@ +server { + listen [::]:80; + + server_name agenda.hebrewtools.org www.agenda.hebrewtools.org; + + access_log /var/log/nginx/agenda.hebrewtools.org.access.log; + error_log /var/log/nginx/agenda.hebrewtools.org.error.log; + + return 301 https://agenda.hebrewtools.org$request_uri; +} + +server { + listen [::]:443; + + root /var/www/agenda.hebrewtools.org; + index list.php; + charset utf-8; + + server_name agenda.hebrewtools.org; + + access_log /var/log/nginx/agenda.hebrewtools.org.access.log; + error_log /var/log/nginx/agenda.hebrewtools.org.error.log; + + include /etc/nginx/confsnippets/ssl.conf; + ssl_certificate /etc/letsencrypt/live/agenda.hebrewtools.org/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/agenda.hebrewtools.org/privkey.pem; + + location / { + autoindex off; + } + + location ~ (add|fetch)\.php { + auth_basic "Agenda administration is only available after login:"; + auth_basic_user_file /etc/nginx/htpasswds/agenda.hebrewtools.org; + include /etc/nginx/confsnippets/fastcgi.conf; + } + + location ~ \.php$ { + include /etc/nginx/confsnippets/fastcgi.conf; + } + + include /etc/nginx/confsnippets/letsencrypt.conf; + + location ~ /\. { + deny all; + } + + include /etc/nginx/confsnippets/expires.conf; +} |