Created
August 21, 2019 02:13
-
-
Save luxwarp/029f3038bf101caffe23126c85a30a10 to your computer and use it in GitHub Desktop.
A typical Nginx server block for Wordpress
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 Wordpress | |
# Author: Mikael Luxwarp Carlsson luxwarp@codeiolo.org https://codeiolo.org | |
# License: ISC | |
# Created: 2019-08-21 | |
server { | |
listen 80; | |
listen [::]:80; | |
root /path/to/wordpress | |
index index.php index.html index.htm; | |
server_name example.com www.example.com; | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
location ~ \.php$ { | |
include snippets/fastcgi-php.conf; | |
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
# Where nginx should write log files. | |
access_log /var/log/nginx/exampe.com.access.log; | |
error_log /var/log/nginx/example.com.error.log; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment