server { listen 80; root /home/ubuntu/rummygo/public; index index.php index.html; client_max_body_size 8M; # Logging -- access_log /var/log/nginx/rummygo.access.log; error_log /var/log/nginx/rummygo.error.log notice; # serve static files directly location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ { access_log off; expires max; } # location / { # if (!-e $request_filename){ # rewrite ^(.*)$ /index.php break; # } # } # rewrite in nginx https://www.nginx.com/blog/converting-apache-to-nginx-rewrite-rules/ location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_index index.php; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; fastcgi_buffer_size 32k; fastcgi_buffers 8 32k; fastcgi_connect_timeout 60; fastcgi_send_timeout 300; fastcgi_read_timeout 300; } }