Skip to content

Instantly share code, notes, and snippets.

@gibrandev
Last active February 21, 2025 06:33
Show Gist options
  • Select an option

  • Save gibrandev/18772948ce6d3744c4a00f528ab70756 to your computer and use it in GitHub Desktop.

Select an option

Save gibrandev/18772948ce6d3744c4a00f528ab70756 to your computer and use it in GitHub Desktop.
Nginx http minimal config for php
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment