2021-11-02 11:59:57 -06:00
|
|
|
user www-data;
|
|
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
events {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
http {
|
2023-04-18 22:03:45 -06:00
|
|
|
client_max_body_size 0;
|
|
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
map $http_upgrade $connection_upgrade {
|
|
|
|
|
default upgrade;
|
|
|
|
|
'' close;
|
|
|
|
|
}
|
2021-11-12 14:13:02 -07:00
|
|
|
charset utf-8;
|
2022-12-09 11:22:20 -07:00
|
|
|
|
2021-11-12 14:13:02 -07:00
|
|
|
include mime.types;
|
2022-12-09 11:22:20 -07:00
|
|
|
types {
|
|
|
|
|
# Custom types for ebooks.
|
|
|
|
|
application/x-mobipocket-ebook mobi;
|
|
|
|
|
application/epub+zip epub;
|
|
|
|
|
}
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2022-01-15 19:34:12 -07:00
|
|
|
error_page 502 /error/50x.html;
|
|
|
|
|
error_page 503 /error/50x.html;
|
|
|
|
|
error_page 504 /error/50x.html;
|
|
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
server {
|
2024-06-12 18:44:59 -06:00
|
|
|
listen 80;
|
|
|
|
|
listen [::]:80;
|
|
|
|
|
server_name _; # Default server for requests without "Host" header
|
2023-05-10 15:24:37 -06:00
|
|
|
|
2024-06-12 18:44:59 -06:00
|
|
|
location / {
|
|
|
|
|
return 301 https://$host$request_uri;
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
2024-06-12 18:44:59 -06:00
|
|
|
}
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2024-06-12 18:44:59 -06:00
|
|
|
server {
|
|
|
|
|
listen 443 ssl;
|
|
|
|
|
listen [::]:443 ssl;
|
|
|
|
|
proxy_pass_header Host;
|
2022-02-03 13:24:51 -07:00
|
|
|
|
2024-06-12 18:44:59 -06:00
|
|
|
# Self-signed cert.
|
|
|
|
|
ssl_certificate /etc/nginx/cert.crt;
|
|
|
|
|
ssl_certificate_key /etc/nginx/cert.key;
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2024-06-12 18:44:59 -06:00
|
|
|
include /etc/nginx/conf.d/*;
|
|
|
|
|
}
|
2023-07-15 12:15:55 -06:00
|
|
|
|
2024-06-12 18:44:59 -06:00
|
|
|
# HTTPS Map is served by Apache2. This is because mod_tile.conf is required to render the map. renderd does not
|
|
|
|
|
# support nginx.
|
2023-05-29 18:04:03 -06:00
|
|
|
|
2024-06-12 18:44:59 -06:00
|
|
|
server {
|
|
|
|
|
# HTTPS Kiwix.
|
|
|
|
|
listen 8085 ssl;
|
|
|
|
|
listen [::]:8085 ssl;
|
|
|
|
|
proxy_pass_header Host;
|
2024-06-18 11:36:09 -06:00
|
|
|
proxy_set_header 'Access-Control-Allow-Origin' '*';
|
2023-05-29 18:04:03 -06:00
|
|
|
|
2024-06-12 18:44:59 -06:00
|
|
|
ssl_certificate /etc/nginx/cert.crt;
|
|
|
|
|
ssl_certificate_key /etc/nginx/cert.key;
|
2022-12-19 10:40:01 -07:00
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
location / {
|
2024-06-12 18:44:59 -06:00
|
|
|
proxy_pass http://0.0.0.0:9085;
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
2024-06-12 18:44:59 -06:00
|
|
|
}
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2024-06-12 18:44:59 -06:00
|
|
|
server {
|
|
|
|
|
# HTTPS Help.
|
|
|
|
|
listen 8086 ssl;
|
|
|
|
|
listen [::]:8086 ssl;
|
|
|
|
|
proxy_pass_header Host;
|
2024-06-18 11:36:09 -06:00
|
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2024-06-12 18:44:59 -06:00
|
|
|
ssl_certificate /etc/nginx/cert.crt;
|
|
|
|
|
ssl_certificate_key /etc/nginx/cert.key;
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2024-06-12 18:44:59 -06:00
|
|
|
location / {
|
|
|
|
|
proxy_pass http://0.0.0.0:9086;
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|