2021-11-02 11:59:57 -06:00
|
|
|
user www-data;
|
|
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
events {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
http {
|
|
|
|
|
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 {
|
2022-01-15 19:34:12 -07:00
|
|
|
location ^~ /error/ {
|
|
|
|
|
internal;
|
|
|
|
|
alias /var/www/;
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
2022-02-03 13:24:51 -07:00
|
|
|
location /favicon.ico {
|
|
|
|
|
alias /opt/wrolpi/icon.ico;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
location /apple-touch-icon.png {
|
2021-11-12 14:48:13 -07:00
|
|
|
alias /opt/wrolpi/icon.png;
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
2022-12-19 10:40:01 -07:00
|
|
|
location /epub.html {
|
|
|
|
|
alias /opt/wrolpi/app/public/epub.html;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
location / {
|
|
|
|
|
# React APP
|
2021-11-02 10:26:07 -06:00
|
|
|
proxy_pass http://127.0.0.1:5000;
|
2022-02-03 10:07:04 -07:00
|
|
|
rewrite $1 break;
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /sockjs-node {
|
2021-11-02 10:26:07 -06:00
|
|
|
proxy_pass http://127.0.0.1:5000;
|
2022-02-03 10:07:04 -07:00
|
|
|
proxy_http_version 1.1;
|
2021-11-01 16:42:52 -06:00
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /api {
|
2021-11-02 10:26:07 -06:00
|
|
|
proxy_pass http://127.0.0.1:8081;
|
2022-02-03 10:07:04 -07:00
|
|
|
rewrite /^api(.*)$ $1 break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /docs {
|
|
|
|
|
proxy_pass http://127.0.0.1:8081;
|
|
|
|
|
rewrite /^docs(.*)$ $1 break;
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /media {
|
2022-12-15 14:25:47 -07:00
|
|
|
# The media files mounted in the docker volume
|
|
|
|
|
sendfile on;
|
|
|
|
|
sendfile_max_chunk 1m;
|
|
|
|
|
|
|
|
|
|
tcp_nopush on;
|
|
|
|
|
tcp_nodelay on;
|
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
|
|
|
|
|
autoindex on;
|
|
|
|
|
autoindex_exact_size off;
|
|
|
|
|
alias /media/wrolpi;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /download {
|
|
|
|
|
# Assume any request here is to download a file from the media directory.
|
2022-12-12 13:41:44 -07:00
|
|
|
if ( $request_filename ~ '^.*/(.+)$' ) {
|
2022-12-15 14:25:47 -07:00
|
|
|
# Always include the filename for downloads.
|
2022-12-12 13:41:44 -07:00
|
|
|
add_header Content-Disposition 'attachment; filename="$1"';
|
|
|
|
|
}
|
2022-12-09 11:22:20 -07:00
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
sendfile on;
|
|
|
|
|
sendfile_max_chunk 1m;
|
|
|
|
|
|
|
|
|
|
tcp_nopush on;
|
|
|
|
|
tcp_nodelay on;
|
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
|
|
|
|
|
autoindex on;
|
|
|
|
|
autoindex_exact_size off;
|
2022-12-15 14:25:47 -07:00
|
|
|
alias /opt/media;
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
2022-03-08 13:26:03 -07:00
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|