2023-01-09 23:26:28 +00:00
|
|
|
user nginx;
|
2023-01-19 00:40:36 +00:00
|
|
|
worker_processes 1;
|
2023-01-09 23:26:28 +00:00
|
|
|
|
|
|
|
error_log /var/log/nginx/error.log notice;
|
|
|
|
pid /var/run/nginx.pid;
|
|
|
|
|
|
|
|
|
|
|
|
events {
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
|
|
|
|
http {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
|
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
2023-01-12 20:12:18 +00:00
|
|
|
|
|
|
|
access_log /var/log/nginx/access.log main;
|
2023-01-09 23:26:28 +00:00
|
|
|
sendfile on;
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
|
|
|
proxy_cache_path /var/cache/nginx keys_zone=owl_cache:20m inactive=24h;
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
server_name localhost;
|
|
|
|
proxy_cache owl_cache;
|
|
|
|
|
|
|
|
location / {
|
2023-01-19 00:40:36 +00:00
|
|
|
root /site-static/;
|
|
|
|
index index.html;
|
|
|
|
gzip_static on;
|
2023-01-25 12:47:47 +00:00
|
|
|
brotli_static on;
|
2023-01-26 20:09:02 +00:00
|
|
|
error_page 404 /404.html;
|
2023-01-09 23:26:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
location /api/ {
|
2023-01-11 13:35:55 +00:00
|
|
|
proxy_pass http://localhost:8460;
|
|
|
|
proxy_cache_key $scheme://$host$uri$is_args$query_string;
|
|
|
|
proxy_ignore_headers Cache-Control;
|
2023-02-02 19:37:48 +00:00
|
|
|
proxy_cache_valid 200 2m; # Evaluate whether 2m or 1m is more appropriate
|
2023-01-25 12:47:47 +00:00
|
|
|
gzip on;
|
|
|
|
brotli on;
|
2023-01-11 13:59:22 +00:00
|
|
|
}
|
2023-01-11 13:35:55 +00:00
|
|
|
|
|
|
|
location /api/v1/list/ {
|
|
|
|
proxy_pass http://localhost:8460;
|
|
|
|
proxy_cache_key $scheme://$host$uri$is_args$query_string;
|
|
|
|
proxy_ignore_headers Cache-Control;
|
2023-01-14 12:12:07 +00:00
|
|
|
proxy_cache_valid 200 10080m;
|
2023-01-11 13:35:55 +00:00
|
|
|
}
|
2023-01-09 23:26:28 +00:00
|
|
|
}
|
|
|
|
}
|