# This is a default site configuration which will simply return 404, preventing # chance access to any other virtualhost. server { listen 80 default_server; root /app/public; client_max_body_size 50M; index index.php index.html index.htm default.php default.htm default.html; # Everything is a 404 location ~ [^/]\.php(/|$) { try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi-74.sock; fastcgi_index index.php; include fastcgi.conf; } location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; break; } } # You may need this to prevent return 404 recursion. location = /404.html { internal; } }