2011-08-24 16:56:30 -04:00
|
|
|
server {
|
2021-11-14 08:12:51 -05:00
|
|
|
listen ${NGINX_PORT};
|
2023-09-25 12:21:08 -04:00
|
|
|
server_name localhost;
|
2021-11-13 21:31:26 -05:00
|
|
|
root /app/public;
|
2011-08-24 16:56:30 -04:00
|
|
|
index index.html;
|
2018-10-16 17:58:30 -04:00
|
|
|
access_log off;
|
2022-02-05 07:48:30 -05:00
|
|
|
client_max_body_size 100m;
|
2023-09-25 10:14:55 -04:00
|
|
|
|
2011-08-24 16:56:30 -04:00
|
|
|
location /data {
|
|
|
|
expires max;
|
|
|
|
break;
|
|
|
|
}
|
2017-03-13 19:26:07 -04:00
|
|
|
|
2023-09-25 10:14:55 -04:00
|
|
|
location /data/deleted/ {
|
|
|
|
add_header Cache-Control "private";
|
|
|
|
secure_link $arg_auth,$arg_expires;
|
|
|
|
secure_link_md5 "$secure_link_expires $uri $arg_uid ${DANBOORU_PROTECTED_FILE_SECRET}";
|
|
|
|
if ($secure_link = "") {
|
|
|
|
return 403;
|
|
|
|
}
|
|
|
|
if ($secure_link = "0") {
|
|
|
|
return 403;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
location /data/replacements/ {
|
|
|
|
add_header Cache-Control "private";
|
|
|
|
secure_link $arg_auth,$arg_expires;
|
|
|
|
secure_link_md5 "$secure_link_expires $uri $arg_uid ${DANBOORU_REPLACEMENT_FILE_SECRET}";
|
|
|
|
if ($secure_link = "") {
|
|
|
|
return 403;
|
|
|
|
}
|
|
|
|
if ($secure_link = "0") {
|
|
|
|
return 403;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-06 13:03:51 -04:00
|
|
|
location /tags/autocomplete.json {
|
|
|
|
proxy_pass http://autocompleted:8118/;
|
|
|
|
proxy_redirect off;
|
|
|
|
}
|
|
|
|
|
2013-04-17 15:03:34 -04:00
|
|
|
location @app_server {
|
|
|
|
proxy_pass http://app_server;
|
|
|
|
proxy_redirect off;
|
2021-11-14 08:12:51 -05:00
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
2013-04-17 15:03:34 -04:00
|
|
|
proxy_set_header Host $host:$server_port;
|
2021-11-14 08:12:51 -05:00
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
2018-01-28 17:09:55 -05:00
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
2013-04-17 15:03:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
location / {
|
|
|
|
try_files $uri @app_server;
|
|
|
|
}
|
2018-10-16 17:58:30 -04:00
|
|
|
|
2011-08-24 16:56:30 -04:00
|
|
|
error_page 404 /404.html;
|
|
|
|
error_page 500 502 503 504 /500.html;
|
2013-04-17 15:03:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
upstream app_server {
|
2021-11-13 21:31:26 -05:00
|
|
|
server e621:9000;
|
2013-04-17 15:03:34 -04:00
|
|
|
}
|