This repository has been archived by the owner on Mar 1, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
nginx-hugo.conf
75 lines (61 loc) · 2.06 KB
/
nginx-hugo.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
worker_processes 1;
events {
worker_connections 1024;
}
http{
include /usr/local/etc/nginx/mime.types;
root %%ROOT_DIR%%;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
#Forward all http connections to https
listen 80 default_server;
listen [::]:80 default_server;
server_name %%SITE_URL%% www.%%SITE_URL%%;
return 301 https://%%SITE_URL%%$request_uri;
}
server {
listen 40001 ssl;
server_name %%SITE_URL%%;
ssl_certificate /usr/local/etc/letsencrypt/live/%%SITE_URL%%/fullchain.pem;
ssl_certificate_key /usr/local/etc/letsencrypt/live/%%SITE_URL%%/privkey.pem;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
root /root/stats-site/web;
#Setup the logging of repo_info.json downloads (ignores other access)
location ~* \.iso$ {
access_log /var/log/nginx-iso.log main;
}
location / {
index index.html;
}
}
server {
listen 443 ssl;
server_name %%SITE_URL%%;
ssl_certificate /usr/local/etc/letsencrypt/live/%%SITE_URL%%/fullchain.pem;
ssl_certificate_key /usr/local/etc/letsencrypt/live/%%SITE_URL%%/privkey.pem;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
#Setup the logging of repo_info.json downloads (ignores other access)
location ~* repo-info\.json$ {
access_log /var/log/nginx-stats.log main;
}
location ~* \.iso$ {
access_log /var/log/nginx-iso.log main;
}
location ~* repodata$ {
access_log /var/log/nginx-pkgs.log main;
}
location / {
index index.html;
try_files $uri $uri/ $uri.html =404;
}
error_page 404 /404.html;
}
}