@@ -202,25 +202,30 @@ are:
202
202
server_name domain.tld www.domain.tld;
203
203
root /var/www/project/web;
204
204
205
- if ($request_uri ~ "/app\.php(/|$)") {
206
- # prevent explicit access and hide front controller
207
- # remove this block if you want to allow uri's like
208
- # http://domain.tld/app.php/some-path
209
- return 404;
210
- }
211
-
212
205
location / {
213
206
# try to serve file directly, fallback to app.php
214
207
try_files $uri /app.php$is_args$args;
215
208
}
216
-
217
- location ~ ^/(app| app_dev|config)\.php(/|$) {
209
+ # DEV
210
+ location ~ ^/(app_dev|config)\.php(/|$) {
218
211
fastcgi_pass unix:/var/run/php5-fpm.sock;
219
212
fastcgi_split_path_info ^(.+\.php)(/.*)$;
220
213
include fastcgi_params;
221
214
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
222
215
fastcgi_param HTTPS off;
223
216
}
217
+ # PROD
218
+ location ~ ^/app\.php(/|$) {
219
+ fastcgi_pass unix:/var/run/php5-fpm.sock;
220
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
221
+ include fastcgi_params;
222
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
223
+ fastcgi_param HTTPS off;
224
+ # prevent explicit access and hide front controller
225
+ # remove "internal" directive if you want to allow uri's like
226
+ # http://domain.tld/app.php/some-path
227
+ internal;
228
+ }
224
229
225
230
error_log /var/log/nginx/project_error.log;
226
231
access_log /var/log/nginx/project_access.log;
0 commit comments