Category: nginx

Service worker not registered when using docker and nginx

I’m facing the problem, that my service worker isnt registered when I use my docker setup. However, if I run my project locally everything works fine. if (‘serviceWorker’ in navigator) { navigator.serviceWorker.register(‘/sw.js’) .then((reg) => console.log(‘Worker registered!’, reg)) .catch((error) => console.log(‘Worker…

Nginx configuration for index.php with fallback to index.html and serving static files

I have a configuration that works for simple index.php and index.html files in such a way that when I request localhost/ firstly index.php is served and if not preset then index.html is served. server { listen 0.0.0.0:80; root /usr/share/nginx/html/public; location…

SymfonyComponentProcessProcess unable to run audit2allow

I’m trying to execute audit2allow using SymfonyComponentProcessProcess. When I run exec(“audit2allow -a -M a2a”); in PHP, it works just fine, a2a.pp and a2a.te is produced. $process = new Process([‘audit2allow’, ‘-a’, ‘-M’, ‘a2a’]); $process->run(); if (!$process->isSuccessful()) { throw new ProcessFailedException($process); }…

Exception should not appear in prod

I have this kind of exception, on a production environnement: Fatal error: Uncaught RuntimeException: Unable to create the cache directory (/app/ezplatform/var/cache/prod/a6d61d85393d8924b6a2d32272d325510651f125) in /app/ezplatform/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:765 Stack trace: #0 /app/ezplatform/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(642): SymfonyComponentHttpKernelKernel->buildContainer() #1 /app/ezplatform/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(135): SymfonyComponentHttpKernelKernel->initializeContainer() #2 /app/ezplatform/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(195): SymfonyComponentHttpKernelKernel->boot() #3 /app/ezplatform/web/app.php(64): SymfonyComponentHttpKernelKernel->handle(Object(SymfonyComponentHttpFoundationRequest)) 4 {main} thrown…

nginx XSendfile "rewrite or internal redirection cycle …" using nginx docker image

I’m working on a PHP application which runs using a docker-compose stack with a seperate nginx container for the HTTP handling. I’m trying to serve static files through PHP and NGINX using NGINX’s XSendfile feature. While this works locally IF…