Skip to content

Instantly share code, notes, and snippets.

@olivertappin
Created January 4, 2020 21:07
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 olivertappin/e9ccaf64458b0a84aa5a8665cc730e2d to your computer and use it in GitHub Desktop.
Save olivertappin/e9ccaf64458b0a84aa5a8665cc730e2d to your computer and use it in GitHub Desktop.
WordPress Nginx configuration
location / {
try_files $uri /index.php$is_args$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~ /\. {
deny all;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/\.user\.ini {
deny all;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment