server { http2 on; listen [::]:80; listen 80; server_name popeye.lapinbilly.eu; # Replace with your hostname root /jails/php/usr/local/www/; index .php; client_max_body_size 15M; client_body_buffer_size 128K; location / { try_files $uri $uri/ @; } location @ { rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; rewrite ^/(.*) /.php?id=$1&$args last; } location ~ \.php$ { try_files $uri $uri/ /.php; # fastcgi_pass 192.168.0.12:9000; fastcgi_pass unix:/jails/php/var/run/php-fpm.sock; fastcgi_param REDIRECT_STATUS 200; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /usr/local/www//$fastcgi_script_name; }