Commits

Anonymous committed 6d2f7f9

Setup the front controller: configure Nginx and allow access from any host

  • Participants
  • Parent commits 5f3620c

Comments (0)

Files changed (2)

+# Set this to "app.php" to go into production mode:
+set $front_controller app_dev.php;
+
+index $front_controller;
+
+try_files $uri /web$uri /web/$front_controller$uri;
+
+location ~ ".+\.php($|/.*)" {
+   if ( -f /home/dotcloud/current/maintenance) {
+       return 503;
+   }
+
+   fastcgi_pass                     unix:/var/dotcloud/php5-fpm.sock;
+   include                          fastcgi_params;
+   include                          /home/dotcloud/current/\*fastcgi.conf;
+   fastcgi_split_path_info          ^(.+\.php)(/.+)$;
+   fastcgi_param PATH_INFO          $fastcgi_path_info;
+   fastcgi_param PATH_TRANSLATED    $document_root$fastcgi_path_info;
+}

File web/app_dev.php

 <?php
 
-// this check prevents access to debug front controllers that are deployed by accident to production servers.
-// feel free to remove this, extend it, or make something more sophisticated.
-if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
-    '127.0.0.1',
-    '::1',
-))) {
-    header('HTTP/1.0 403 Forbidden');
-    exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
-}
-
 require_once __DIR__.'/../app/bootstrap.php.cache';
 require_once __DIR__.'/../app/AppKernel.php';