Skip to content

Commit

Permalink
Merge branch 'main' into fix/delivery-retry-on-post-failure
Browse files Browse the repository at this point in the history
  • Loading branch information
BentiGorlich authored Nov 22, 2024
2 parents 00cf554 + 061225f commit 9bc4daa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
16 changes: 14 additions & 2 deletions docs/02-admin/01-installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ files.
NGINX reverse proxy example for the Mbin Docker instance:

```nginx
upstream backend {
server 127.0.0.1:8008;
keepalive 12;
}
# Map between POST requests on inbox vs the rest
map $request $inboxRequest {
~^POST\ \/f\/inbox 1;
Expand Down Expand Up @@ -243,17 +248,24 @@ server {
access_log /var/log/nginx/mbin_access.log if=$regularRequest;
access_log /var/log/nginx/mbin_inbox.log if=$inboxRequest buffer=32k flush=5m;
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
location / {
proxy_http_version 1.1;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-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_pass http://127.0.0.1:8008;
proxy_set_header Connection "";
proxy_pass http://backend;
}
location /.well-known/mercure {
proxy_pass http://127.0.0.1:8008$request_uri;
proxy_pass http://backend$request_uri;
proxy_read_timeout 24h;
proxy_http_version 1.1;
proxy_set_header Connection "";
Expand Down
14 changes: 12 additions & 2 deletions docs/02-admin/02-configuration/nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ gzip on;
gzip_disable msie6;
gzip_vary on;
gzip_comp_level 3;
gzip_comp_level 5;
gzip_min_length 256;
gzip_buffers 16 8k;
gzip_proxied any;
Expand Down Expand Up @@ -85,6 +85,11 @@ sudo nano /etc/nginx/sites-available/mbin.conf
With the content:

```nginx
upstream mercure {
server 127.0.0.1:3000;
keepalive 10;
}
# Map between POST requests on inbox vs the rest
map $request $inboxRequest {
~^POST\ \/f\/inbox 1;
Expand Down Expand Up @@ -140,6 +145,11 @@ server {
access_log /var/log/nginx/mbin_access.log if=$regularRequest;
access_log /var/log/nginx/mbin_inbox.log if=$inboxRequest buffer=32k flush=5m;
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
Expand All @@ -149,7 +159,7 @@ server {
location = /robots.txt { allow all; access_log off; log_not_found off; }
location /.well-known/mercure {
proxy_pass http://127.0.0.1:3000$request_uri;
proxy_pass http://mercure$request_uri;
# Increase this time-out if you want clients have a Mercure connection open for longer (eg. 24h)
proxy_read_timeout 2h;
proxy_http_version 1.1;
Expand Down

0 comments on commit 9bc4daa

Please sign in to comment.