-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
44 lines (44 loc) · 999 Bytes
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
server
{
listen 80 default_server;
listen [::]:80 default_server;
#set server name include www if necessary for config
server_name www.example.com;
#set redirect to second server block
return 301 https://$server_name$request_uri;
location = /favicon.ico
{
log_not_found off; access_log off;
}
location = /robots.txt
{
log_not_found off; access_log off; allow all;
}
location ~* \.(css|gif|ico|jpeg|jpg|js|png)$
{
expires max;
log_not_found off;
}
}
server
{
#enables http2 within block
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
#include snippet configs
include snippets/ssl-www.example.com.conf;
include snippets/ssl-params.conf;
#root of project
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
#ensure directory is open for validation
location ~ /.well-known
{
allow all;
}
#deny access to .htaccess files
location ~ /\.ht
{
deny all;
}
}