Skip to content

Instantly share code, notes, and snippets.

@xeviknal
Created April 27, 2016 08:35
Show Gist options
  • Save xeviknal/8c5248d15086ec20830e2ef103d30cbf to your computer and use it in GitHub Desktop.
Save xeviknal/8c5248d15086ec20830e2ef103d30cbf to your computer and use it in GitHub Desktop.
Nginx server setup for serving a Wordress instance
server {
listen 80;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/xml application/json text/css application/javascript image/svg+xml;
root /var/www/et-blog/current;
server_name blog.mydomain.com;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* .(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 1y;
log_not_found off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment