-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnginx-vhost-sample.conf
119 lines (101 loc) · 3.77 KB
/
nginx-vhost-sample.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
# BNETDocs, the Battle.net(TM) protocol documentation and discussion website
# Copyright (C) 2008-2020 "Arta", Don Cullen "Kyro", Carl Bennett, others
# This file is part of BNETDocs.
#
# BNETDocs is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BNETDocs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with BNETDocs. If not, see <http://www.gnu.org/licenses/>.
#
# This is a sample of the production BNETDocs website's nginx configuration.
# It is NOT intended to be used in place of your actual configuration.
#
server {
listen 80;
listen [::]:80;
server_name bnetdocs.org;
include conf.d/error-pages.conf;
include conf.d/gzip.conf;
include conf.d/url-filter*.conf;
location / {
return 301 https://$host$request_uri;
}
}
server {
ssl_certificate /etc/letsencrypt/live/bnetdocs.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/bnetdocs.org/privkey.pem; # managed by Certbot
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.bnetdocs.org;
include conf.d/error-pages.conf;
include conf.d/url-filter*.conf;
location / {
return 301 https://bnetdocs.org$request_uri;
}
}
map $sent_http_content_type $bnetdocs_expires {
default off;
~application/ 1y;
~image/ 1y;
~text/ 1y;
~video/ 1y;
}
server {
ssl_certificate /etc/letsencrypt/live/bnetdocs.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/bnetdocs.org/privkey.pem; # managed by Certbot
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name bnetdocs.org;
include conf.d/error-pages.conf;
include conf.d/url-filter*.conf;
root /var/www/www.bnetdocs.org/src;
index index.html index.xml index.htm;
location / {
expires $bnetdocs_expires;
try_files /Static$uri /main.php$is_args$args;
}
location /a/ {
expires $bnetdocs_expires;
try_files /Static$uri /main.php$is_args$args;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET,HEAD,OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
rewrite ^/archives(/.*)?$ $scheme://files.bnetdocs.org$1 last;
location = /.well-known/change-password {
return 302 $scheme://$host/user/changepassword$is_args$args;
}
location = /favicon.ico {
return 302 $scheme://$host/favicon.png$is_args$args;
}
location = /google7a3f778535b1424a.html {
return 200 "google-site-verification: google7a3f778535b1424a.html";
}
location = /main.php {
add_header Strict-Transport-Security max-age=15552000; # 15552000 = 180 days
fastcgi_hide_header X-Powered-By;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors off;
fastcgi_param PHP_VALUE "date.timezone = Etc/UTC
display_errors = Off
error_reporting = E_ALL
short_open_tag = On";
fastcgi_pass unix:/var/run/php-fpm/www.sock;
include fastcgi.conf;
}
}