root@diavita-newprod:/etc/nginx/sites-enabled# cat bstest-symshop-ms.conf server { listen 80; # include snippets/https.conf; server_name bstest-symshop-ms.diavita-dev.com; # App paths set $root_path '/home/diavita/symshop_bstest/web'; root $root_path; index index.php index.html index.htm; # App settings charset utf-8; client_max_body_size 20M; # Logging access_log /var/log/nginx/bstest-symshop-ds.diavita-dev.com.access.log; error_log /var/log/nginx/bstest-symshop-ds.diavita-dev.com.error.log error; location / { autoindex off; index app.php; try_files $uri $uri/ /app.php?$query_string; } # PHP-FPM settings location ~ \.php$ { try_files $uri = 404; include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9228; fastcgi_index app.php; fastcgi_param HTTP_X_FILENAME $http_x_filename; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; # Prevent header too big errors fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; } # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac). # Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban) location ~ /\. { deny all; } location /robots.txt {return 200 "User-agent: *\nDisallow: /\n";} }