Skip to content

Instantly share code, notes, and snippets.

@tyraeltong
Created October 4, 2011 15:34
Show Gist options
  • Select an option

  • Save tyraeltong/1261953 to your computer and use it in GitHub Desktop.

Select an option

Save tyraeltong/1261953 to your computer and use it in GitHub Desktop.
setup wordpress on linode vps part 2
server{
listen 80; #or change this to your public IP address eg 1.1.1.1:80
server_name wordpress; #change this to the domain name, for example www.myblog.com
access_log /var/log/wordpress.access_log;
error_log /var/log/wordpress.error_log;
location / {
root /home/your-user-name/Sites/wordpress;
index index.php index.html index.htm;
# this serves static files that exist without running other rewrite tests
if (-f $request_filename) {
expires 30d;
break;
}
# this sends all non-existing file or directory requests to index.php
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/your-user-name/Sites/wordpress$fastcgi_script_name;
include fastcgi_params;
}
}
sudo vim /etc/nginx/sites-available/wordpress
sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/wordpress
sudo service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment