|
1 | 1 | #
|
2 | 2 | # BNETDocs, the Battle.net(TM) protocol documentation and discussion website
|
3 |
| -# Copyright (C) 2008-2016 Carl Bennett |
| 3 | +# Copyright (C) 2008-2020 "Arta", Don Cullen "Kyro", Carl Bennett, others |
4 | 4 | # This file is part of BNETDocs.
|
5 | 5 | #
|
6 | 6 | # BNETDocs is free software: you can redistribute it and/or modify
|
|
20 | 20 | # It is NOT intended to be used in place of your actual configuration.
|
21 | 21 | #
|
22 | 22 | server {
|
| 23 | + listen 80; |
| 24 | + listen [::]:80; |
| 25 | + server_name bnetdocs.org; |
23 | 26 |
|
24 |
| - listen 80; |
25 |
| - listen [::]:80; |
26 |
| - server_name bnetdocs.org; |
27 |
| - |
28 |
| - include conf.d/error-pages.conf; |
29 |
| - include conf.d/gzip.conf; |
30 |
| - include conf.d/url-filter*.conf; |
| 27 | + include conf.d/error-pages.conf; |
| 28 | + include conf.d/gzip.conf; |
| 29 | + include conf.d/url-filter*.conf; |
31 | 30 |
|
32 | 31 | location / {
|
33 |
| - return 301 https://$host$uri$is_args$args; |
| 32 | + return 301 https://$host$request_uri; |
34 | 33 | }
|
35 |
| - |
36 | 34 | }
|
37 | 35 | server {
|
| 36 | + ssl_certificate /etc/letsencrypt/live/bnetdocs.org/fullchain.pem; # managed by Certbot |
| 37 | + ssl_certificate_key /etc/letsencrypt/live/bnetdocs.org/privkey.pem; # managed by Certbot |
38 | 38 |
|
39 |
| - ssl_certificate sites-certs/bnetdocs-www.crt; |
40 |
| - ssl_certificate_key sites-certs/bnetdocs-www.key; |
41 |
| - |
42 |
| - listen 80; |
43 |
| - listen [::]:80; |
44 |
| - listen 443 ssl http2; |
45 |
| - listen [::]:443 ssl http2; |
46 |
| - server_name .www.bnetdocs.org; |
| 39 | + listen 80; |
| 40 | + listen [::]:80; |
| 41 | + listen 443 ssl http2; |
| 42 | + listen [::]:443 ssl http2; |
| 43 | + server_name www.bnetdocs.org; |
47 | 44 |
|
48 |
| - include conf.d/error-pages.conf; |
49 |
| - include conf.d/gzip.conf; |
50 |
| - include conf.d/url-filter*.conf; |
| 45 | + include conf.d/error-pages.conf; |
| 46 | + include conf.d/url-filter*.conf; |
51 | 47 |
|
52 | 48 | location / {
|
53 |
| - return 301 https://bnetdocs.org$uri$is_args$args; |
| 49 | + return 301 https://bnetdocs.org$request_uri; |
54 | 50 | }
|
55 | 51 | }
|
56 | 52 | map $sent_http_content_type $bnetdocs_expires {
|
57 |
| - default off; |
58 |
| - ~application/ 1y; |
59 |
| - ~image/ 1y; |
60 |
| - ~text/ 1y; |
61 |
| - ~video/ 1y; |
| 53 | + default off; |
| 54 | + ~application/ 1y; |
| 55 | + ~image/ 1y; |
| 56 | + ~text/ 1y; |
| 57 | + ~video/ 1y; |
62 | 58 | }
|
63 | 59 | server {
|
| 60 | + ssl_certificate /etc/letsencrypt/live/bnetdocs.org/fullchain.pem; # managed by Certbot |
| 61 | + ssl_certificate_key /etc/letsencrypt/live/bnetdocs.org/privkey.pem; # managed by Certbot |
64 | 62 |
|
65 |
| - ssl_certificate sites-certs/bnetdocs-www.crt; |
66 |
| - ssl_certificate_key sites-certs/bnetdocs-www.key; |
| 63 | + listen 443 ssl http2; |
| 64 | + listen [::]:443 ssl http2; |
| 65 | + server_name bnetdocs.org; |
67 | 66 |
|
68 |
| - listen 443 ssl http2; |
69 |
| - listen [::]:443 ssl http2; |
70 |
| - server_name bnetdocs.org; |
| 67 | + include conf.d/error-pages.conf; |
| 68 | + include conf.d/url-filter*.conf; |
71 | 69 |
|
72 |
| - include conf.d/error-pages.conf; |
73 |
| - include conf.d/gzip.conf; |
74 |
| - include conf.d/url-filter*.conf; |
75 |
| - |
76 |
| - root /home/nginx/bnetdocs-www/src; |
77 |
| - index index.html index.xml index.htm; |
| 70 | + root /var/www/www.bnetdocs.org/src; |
| 71 | + index index.html index.xml index.htm; |
78 | 72 |
|
79 | 73 | location / {
|
| 74 | + expires $bnetdocs_expires; |
| 75 | + try_files /static$uri /main.php$is_args$args; |
| 76 | + } |
| 77 | + |
| 78 | + location /a/ { |
80 | 79 | expires $bnetdocs_expires;
|
81 | 80 | try_files /static$uri /main.php$is_args$args;
|
| 81 | + add_header 'Access-Control-Allow-Origin' '*'; |
| 82 | + add_header 'Access-Control-Allow-Methods' 'GET,HEAD,OPTIONS'; |
| 83 | + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; |
| 84 | + add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; |
82 | 85 | }
|
83 | 86 |
|
84 |
| - rewrite ^/archives(/.*)?$ https://redux.bnetdocs.org/archives$1 last; |
| 87 | + rewrite ^/archives(/.*)?$ $scheme://files.bnetdocs.org$1 last; |
85 | 88 |
|
86 | 89 | location = /favicon.ico {
|
87 |
| - return 302 $scheme://$host/favicon.png$is_args$args; |
| 90 | + return 302 $scheme://$host/favicon.png$is_args$args; |
88 | 91 | }
|
89 | 92 |
|
90 |
| - location = /main.php { |
91 |
| - fastcgi_hide_header X-Powered-By; |
92 |
| - add_header Strict-Transport-Security max-age=86400; |
93 |
| - fastcgi_buffer_size 128k; |
94 |
| - fastcgi_buffers 256 16k; |
95 |
| - fastcgi_busy_buffers_size 256k; |
96 |
| - fastcgi_intercept_errors off; |
97 |
| - fastcgi_param PHP_VALUE |
98 |
| - "display_errors = On |
99 |
| - error_reporting = E_ALL |
100 |
| - short_open_tag = Off"; |
101 |
| - fastcgi_pass unix:/run/php-fpm/www.sock; |
102 |
| - fastcgi_temp_file_write_size 256k; |
103 |
| - include fastcgi.conf; |
| 93 | + location = /google7a3f778535b1424a.html { |
| 94 | + return 200 "google-site-verification: google7a3f778535b1424a.html"; |
104 | 95 | }
|
105 | 96 |
|
| 97 | + location = /main.php { |
| 98 | + add_header Strict-Transport-Security max-age=15552000; # 15552000 = 180 days |
| 99 | + |
| 100 | + fastcgi_hide_header X-Powered-By; |
| 101 | + |
| 102 | + fastcgi_buffer_size 128k; |
| 103 | + fastcgi_buffers 256 16k; |
| 104 | + fastcgi_busy_buffers_size 256k; |
| 105 | + fastcgi_temp_file_write_size 256k; |
| 106 | + |
| 107 | + fastcgi_intercept_errors off; |
| 108 | + fastcgi_param PHP_VALUE "date.timezone = Etc/UTC |
| 109 | + display_errors = Off |
| 110 | + error_reporting = E_ALL |
| 111 | + short_open_tag = On"; |
| 112 | + fastcgi_pass unix:/var/run/php-fpm/www.sock; |
| 113 | + include fastcgi.conf; |
| 114 | + } |
106 | 115 | }
|
0 commit comments