rob-revisited/tools/embed/examples/nginx.conf

18 lines
1 KiB
Nginx Configuration File

# nginx in front of a site: /chat/ answered by the JumPHP embed kit (tools/embed/jumphp-embed.php, docs/embed.md), the rest as before.
# The kit streams the big files itself: no buffering, a long timeout. Keep the secret out of the web root (an fastcgi_param or the
# PHP-FPM pool's env[]).
location = /chat { return 301 /chat/$is_args$args; }
location ^~ /chat/ {
gzip off; # the kit passes the playground's gzip through
fastcgi_buffering off;
fastcgi_read_timeout 300s;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /srv/jumphp-embed/jumphp-embed.php;
fastcgi_param JUMPHP_EMBED_SERVER https://jumphp.net;
fastcgi_param JUMPHP_EMBED_APP caramail-chat;
fastcgi_param JUMPHP_EMBED_SITE es_xxxxxxxxxxxxxxxxxxxx;
fastcgi_param JUMPHP_EMBED_SECRET jes_xxxxxxxx; # or env[JUMPHP_EMBED_SECRET] in the FPM pool
fastcgi_param JUMPHP_EMBED_BASE /chat;
fastcgi_param JUMPHP_EMBED_CACHE /var/cache/jumphp-embed;
fastcgi_pass unix:/run/php/php-fpm.sock;
}