# Basic nginx config for tkr in subfolder # e.g. https://your-domain.com/tkr # For use with included docker-compose.yml server { listen 80 default_server; server_name localhost; root /var/www/html; index index.html; location /tkr { alias /var/www/tkr/public; index index.php; # Block access to sensitive directories location ~ ^/tkr/(storage|src|templates|config) { deny all; return 404; } # Block access to hidden files location ~ /\. { deny all; } # Handle PHP files location ~ \.php$ { fastcgi_pass php:9000; fastcgi_param SCRIPT_FILENAME /var/www/tkr/public/index.php; include fastcgi_params; } # Front controller pattern # Send everything else to index.php try_files $uri $uri/ @tkr; } location @tkr { fastcgi_pass php:9000; fastcgi_param SCRIPT_FILENAME /var/www/tkr/public/index.php; include fastcgi_params; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param REQUEST_URI $request_uri; fastcgi_param QUERY_STRING $query_string; } }