server { listen 80; server_name {{ server_name }}; root {{ webserver_vhost_root }}/; include {{ webserver_nginx_config_folder_path }}/{{ webserver_config_include_file_name }}; {% if webserver_nginx_has_auth_restriction == true and target_environment != "production" %} include {{ webserver_nginx_config_folder_path }}/auth/common.conf; if ($http_user_agent ~* (bot) ) { return 403; } {% endif %} if ($scheme != "https") { return 301 https://$host$request_uri; } client_max_body_size 300m; index index.php; location /favicon.ico { log_not_found off; access_log off; } location / { # Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { try_files $uri /index.php =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:{{ php_port }}; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_intercept_errors on; fastcgi_read_timeout 300; } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off; } }