Skip to content

Instantly share code, notes, and snippets.

@luxwarp
Created August 21, 2019 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luxwarp/029f3038bf101caffe23126c85a30a10 to your computer and use it in GitHub Desktop.
Save luxwarp/029f3038bf101caffe23126c85a30a10 to your computer and use it in GitHub Desktop.
A typical Nginx server block for Wordpress
# 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