Last active
October 30, 2021 19:45
-
-
Save sitemapxml/f84fa83854318550e4650a141cc79d3e to your computer and use it in GitHub Desktop.
Nginx sample for php-fpm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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