mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 09:38:51 +02:00
79 lines
2.3 KiB
Plaintext
79 lines
2.3 KiB
Plaintext
worker_processes 4;
|
|
|
|
error_log /opt/bitnami/nginx/logs/error.log;
|
|
pid /opt/bitnami/nginx/tmp/nginx.pid;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
access_log /opt/bitnami/nginx/logs/proxy_access.log;
|
|
error_log /opt/bitnami/nginx/logs/proxy_error.log;
|
|
|
|
sendfile on;
|
|
keepalive_timeout 180s;
|
|
send_timeout 180s;
|
|
|
|
map $request_method $cache_bypass {
|
|
default 0;
|
|
POST 1;
|
|
}
|
|
|
|
client_body_temp_path /opt/bitnami/nginx/tmp/client_temp;
|
|
proxy_temp_path /opt/bitnami/nginx/tmp/proxy_temp_path;
|
|
fastcgi_temp_path /opt/bitnami/nginx/tmp/fastcgi_temp;
|
|
uwsgi_temp_path /opt/bitnami/nginx/tmp/uwsgi_temp;
|
|
scgi_temp_path /opt/bitnami/nginx/tmp/scgi_temp;
|
|
|
|
proxy_cache_path /dev/shm levels=1:2 keys_zone=mcache:16m inactive=600s max_size=512m;
|
|
proxy_cache_methods GET HEAD;
|
|
proxy_cache_min_uses 1;
|
|
proxy_cache_key "$request_method$host$request_uri";
|
|
proxy_cache_use_stale timeout updating;
|
|
proxy_ignore_headers Cache-Control Expires Set-Cookie;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name frontend;
|
|
|
|
location /api {
|
|
proxy_pass http://htwkalender-backend:8090;
|
|
client_max_body_size 20m;
|
|
proxy_connect_timeout 600s;
|
|
proxy_read_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
send_timeout 600s;
|
|
}
|
|
|
|
# Cache only specific URI
|
|
location /api/modules {
|
|
proxy_pass http://htwkalender-backend:8090;
|
|
client_max_body_size 20m;
|
|
proxy_connect_timeout 600s;
|
|
proxy_read_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
send_timeout 600s;
|
|
proxy_cache_bypass 0;
|
|
proxy_no_cache 0;
|
|
proxy_cache mcache; # mcache=RAM
|
|
proxy_cache_valid 200 301 302 30m;
|
|
proxy_cache_valid 403 404 5m;
|
|
proxy_cache_lock on;
|
|
proxy_cache_use_stale timeout updating;
|
|
add_header X-Proxy-Cache $upstream_cache_status;
|
|
}
|
|
|
|
location /_ {
|
|
proxy_pass http://htwkalender-backend:8090;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://htwkalender-frontend:8000;
|
|
}
|
|
}
|
|
}
|