-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Nginx-Craft virtual host configuration file | ||
# @author nystudio107 | ||
# @copyright Copyright (c) 2016 nystudio107 | ||
# @link https://nystudio107.com/ | ||
# @package nginx-craft | ||
# @since 1.0.11 | ||
# @license MIT | ||
|
||
# This is a BASIC Nginx config for Craft, suitable for use in for local development | ||
# DO NOT use this config in production, it is not performant. Instead, use the | ||
# somedomain.com.conf config | ||
server { | ||
# Listen for both IPv4 & IPv6 on port 80 | ||
listen 80; | ||
listen [::]:80; | ||
|
||
# General virtual host settings | ||
server_name SOMEDOMAIN.com; | ||
root "/var/www/SOMEDOMAIN/public"; | ||
index index.html index.htm index.php; | ||
charset utf-8; | ||
|
||
# 404 error handler | ||
error_page 404 /index.php?$query_string; | ||
|
||
# Access and error logging | ||
access_log off; | ||
error_log /var/log/nginx/SOMEDOMAIN.com-error.log error; | ||
# If you want error logging to go to SYSLOG (for services like Papertrailapp.com), uncomment the following: | ||
#error_log syslog:server=unix:/dev/log,facility=local7,tag=nginx,severity=error; | ||
|
||
# Root directory location handler | ||
location / { | ||
try_files $uri/index.html $uri $uri/ /index.php?$query_string; | ||
} | ||
|
||
# php-fpm configuration | ||
location ~ [^/]\.php(/|$) { | ||
try_files $uri $uri/ /index.php?$query_string; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
# Change this to whatever version of php you are using | ||
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
fastcgi_param HTTP_PROXY ""; | ||
|
||
fastcgi_intercept_errors off; | ||
fastcgi_buffer_size 16k; | ||
fastcgi_buffers 4 16k; | ||
fastcgi_connect_timeout 300; | ||
fastcgi_send_timeout 300; | ||
fastcgi_read_timeout 300; | ||
} | ||
|
||
# Disable reading of Apache .htaccess files | ||
location ~ /\.ht { | ||
deny all; | ||
} | ||
|
||
# Misc settings | ||
sendfile off; | ||
client_max_body_size 100m; | ||
} |