repo.me/deployment/nginx.conf
loveuer 6e866b83e4 feat: as docker mirror registry
feat: add global proxy config
upgrade: upgrade front(angular) to 19
chore: deployment staff
  1. Dockerfile: build frontend, backend, and run in nginx base image
2024-12-23 22:46:34 -08:00

53 lines
1.3 KiB
Nginx Configuration File

user root;
worker_processes auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
tcp_nopush on;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
# log_format custom '[$time_local] [$remote_addr] [$status] [$request_time] [$request_uri]';
# access_log /var/log/nginx/access.log custom;
access_log off;
gzip on;
server {
client_max_body_size 5m;
location /_api {
proxy_pass http://127.0.0.1:8383;
# Add headers to support SSE
proxy_http_version 1.1;
proxy_set_header Connection '';
proxy_set_header Host $host;
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;
# Disable buffering for SSE
proxy_buffering off;
proxy_cache off;
proxy_ignore_client_abort on;
}
location / {
root /app/dist/front/browser;
index index.html;
try_files $uri $uri/ /index.html;
}
}
}