Created
February 20, 2020 10:26
-
-
Save luxwarp/da100737f99d490c8240dd0a5e94a3c7 to your computer and use it in GitHub Desktop.
A typical Nginx server block for Concrete5 https://www.concrete5.org/
This file contains 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
# A typical Nginx server block for Concrete5 https://www.concrete5.org/ | |
# Author: Mikael Luxwarp Carlsson mikael.m.carlsson@gmail.com https://luxwarp.info | |
# License: MIT | |
server { | |
listen 80; | |
listen [::]:80; | |
# the path to site web root (eg /var/www/html). | |
root /path/to/concrete/web/site; | |
# name of index files that can be used inside web root. | |
index index.html index.htm index.php; | |
# The urls this config should listen to. | |
server_name exampe.com www.exampele.com; | |
access_log /var/log/nginx/example.com.access.log; | |
error_log /var/log/nginx/example.com.error.log; | |
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac). | |
location ~ /\. { | |
deny all; | |
access_log off; | |
log_not_found off; | |
} | |
# How urls should be processed. | |
location / { | |
try_files $uri $uri/ /index.php?q=$uri&$args; | |
} | |
# Php-fpm config. | |
location ~ \.php$ { | |
try_files $uri = 404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment