Skip to content

Instantly share code, notes, and snippets.

@sitemapxml
Last active October 30, 2021 19:45
Show Gist options
  • Save sitemapxml/f84fa83854318550e4650a141cc79d3e to your computer and use it in GitHub Desktop.
Save sitemapxml/f84fa83854318550e4650a141cc79d3e to your computer and use it in GitHub Desktop.
Nginx sample for php-fpm
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.php;
server_name _;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include /etc/nginx/snippets/fastcgi-php.conf;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment