server { listen 80; server_name _; root /var/www/html/public; index index.php; charset utf-8; client_max_body_size 50M; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; fastcgi_read_timeout 300; fastcgi_param DOCUMENT_ROOT $realpath_root; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 30d; add_header Cache-Control "public, immutable"; try_files $uri =404; } location ~ /\. { deny all; } }