1
0
ketr.chat/server/nginx.conf
James Ketrenos 3e5d4b0cbf Project seeded
Signed-off-by: James Ketrenos <james@ketrenos.com>
2023-03-30 10:49:31 -07:00

47 lines
1.3 KiB
Nginx Configuration File

server {
root /home/user;
index index.html;
access_log /var/log/nginx/access.log;
error_log stderr;
autoindex on;
# proxy_pass has automatic redirect from v1 -> v1/
# Set the API redirect early in case endpoints have similar names
# to other location matches.
location /api/v1/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass_header Set-Cookie;
proxy_pass_header P3P;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://localhost:8911/api/v1/;
}
# Set tail-pre injection for log files
location ~ .*/*\.log$ {
add_header Cache-Control "no-cache";
add_before_body /tail-pre.html;
default_type text/html;
add_after_body /tail-post.html;
}
location ~ /tail.*\.(html|js|css) {
root /home/user/client/public/;
}
# 'active.conf' is copied during docker build based on whether
# DEVELOPMENT is set (development.conf) or not (production.conf)
include snippets/active.location;
location ~ /(db|conf) {
deny all;
return 404;
}
}