2026-10-14 01:46:48 +03:00
|
|
|
limit_req_zone $binary_remote_addr zone=keycloak_auth:10m rate=10r/m;
|
|
|
|
|
|
2024-12-22 03:18:17 +03:00
|
|
|
server {
|
|
|
|
|
listen 80 default_server;
|
|
|
|
|
listen [::]:80 default_server;
|
|
|
|
|
|
|
|
|
|
root /var/www/html;
|
|
|
|
|
|
|
|
|
|
index index.html index.htm index.nginx-debian.html;
|
|
|
|
|
|
|
|
|
|
server_name _;
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ =404;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
root /var/www/html;
|
|
|
|
|
|
|
|
|
|
index index.html index.htm index.nginx-debian.html;
|
|
|
|
|
server_name playmancala.app; # managed by Certbot
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
proxy_pass http://localhost:3000;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listen [::]:443 ssl ipv6only=on; # managed by Certbot
|
|
|
|
|
listen 443 ssl; # managed by Certbot
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/playmancala.app/fullchain.pem; # managed by Certbot
|
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/playmancala.app/privkey.pem; # managed by Certbot
|
|
|
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
|
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
if ($host = playmancala.app) {
|
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
|
} # managed by Certbot
|
|
|
|
|
|
|
|
|
|
listen 80 ;
|
|
|
|
|
listen [::]:80 ;
|
|
|
|
|
server_name playmancala.app;
|
|
|
|
|
return 404; # managed by Certbot
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
root /var/www/html;
|
|
|
|
|
|
|
|
|
|
index index.html index.htm index.nginx-debian.html;
|
|
|
|
|
server_name api.playmancala.app; # managed by Certbot
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
proxy_pass http://localhost:5000;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
|
|
|
|
|
# WebSocket support
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listen [::]:443 ssl; # managed by Certbot
|
|
|
|
|
listen 443 ssl; # managed by Certbot
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/api.playmancala.app/fullchain.pem; # managed by Certbot
|
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/api.playmancala.app/privkey.pem; # managed by Certbot
|
|
|
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
|
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
if ($host = api.playmancala.app) {
|
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
|
} # managed by Certbot
|
|
|
|
|
|
|
|
|
|
listen 80 ;
|
|
|
|
|
listen [::]:80 ;
|
|
|
|
|
server_name api.playmancala.app;
|
|
|
|
|
return 404; # managed by Certbot
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
root /var/www/html;
|
|
|
|
|
|
|
|
|
|
index index.html index.htm index.nginx-debian.html;
|
|
|
|
|
server_name auth.playmancala.app; # managed by Certbot
|
|
|
|
|
|
2026-10-14 01:46:48 +03:00
|
|
|
# Keycloak sends large cookies and headers.
|
|
|
|
|
proxy_buffer_size 128k;
|
|
|
|
|
proxy_buffers 4 256k;
|
|
|
|
|
proxy_busy_buffers_size 256k;
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
|
|
|
|
|
|
# Every guest login creates a Keycloak user, so limit how often one IP can start a login.
|
|
|
|
|
location = /realms/mancala/protocol/openid-connect/auth {
|
|
|
|
|
limit_req zone=keycloak_auth burst=20 nodelay;
|
|
|
|
|
limit_req_status 429;
|
|
|
|
|
proxy_pass http://localhost:8080;
|
|
|
|
|
}
|
2024-12-22 03:18:17 +03:00
|
|
|
|
|
|
|
|
location / {
|
2026-10-14 01:46:48 +03:00
|
|
|
proxy_pass http://localhost:8080;
|
2024-12-22 03:18:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listen [::]:443 ssl; # managed by Certbot
|
|
|
|
|
listen 443 ssl; # managed by Certbot
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/auth.playmancala.app/fullchain.pem; # managed by Certbot
|
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/auth.playmancala.app/privkey.pem; # managed by Certbot
|
|
|
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
|
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
if ($host = auth.playmancala.app) {
|
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
|
} # managed by Certbot
|
|
|
|
|
|
|
|
|
|
listen 80 ;
|
|
|
|
|
listen [::]:80 ;
|
|
|
|
|
server_name auth.playmancala.app;
|
|
|
|
|
return 404; # managed by Certbot
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
root /var/www/html;
|
|
|
|
|
|
|
|
|
|
index index.html index.htm index.nginx-debian.html;
|
|
|
|
|
server_name ci.playmancala.app; # managed by Certbot
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
proxy_pass http://localhost:8090;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listen [::]:443 ssl; # managed by Certbot
|
|
|
|
|
listen 443 ssl; # managed by Certbot
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/ci.playmancala.app/fullchain.pem; # managed by Certbot
|
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/ci.playmancala.app/privkey.pem; # managed by Certbot
|
|
|
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
|
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
if ($host = ci.playmancala.app) {
|
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
|
} # managed by Certbot
|
|
|
|
|
|
|
|
|
|
listen 80 ;
|
|
|
|
|
listen [::]:80 ;
|
|
|
|
|
server_name ci.playmancala.app;
|
|
|
|
|
return 404; # managed by Certbot
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
root /var/www/html;
|
|
|
|
|
|
|
|
|
|
index index.html index.htm index.nginx-debian.html;
|
|
|
|
|
server_name code.playmancala.app; # managed by Certbot
|
|
|
|
|
|
|
|
|
|
client_max_body_size 50m;
|
|
|
|
|
location / {
|
|
|
|
|
proxy_pass http://localhost:4000;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listen [::]:443 ssl; # managed by Certbot
|
|
|
|
|
listen 443 ssl; # managed by Certbot
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/code.playmancala.app/fullchain.pem; # managed by Certbot
|
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/code.playmancala.app/privkey.pem; # managed by Certbot
|
|
|
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
|
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
if ($host = code.playmancala.app) {
|
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
|
} # managed by Certbot
|
|
|
|
|
|
|
|
|
|
listen [::]:80 ;
|
|
|
|
|
server_name code.playmancala.app;
|
|
|
|
|
return 404; # managed by Certbot
|
|
|
|
|
}
|