Skip to content

Instantly share code, notes, and snippets.

@penghou620
Created September 29, 2014 20:39
Show Gist options
  • Save penghou620/640b2210c0d277d4e677 to your computer and use it in GitHub Desktop.
Save penghou620/640b2210c0d277d4e677 to your computer and use it in GitHub Desktop.
This is nginx configuration file for WordPress and Node.js running parallel.
server {
listen 80;
root /var/www;
index index.php index.html index.htm;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
#fastcgi_split_path_info ^(/blog)(/.*)$; //cause 'invalid post type' on 'edit.php' page, so comment out
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
location /blog {
try_files $uri $uri/ /blog/index.php?$args;
}
location / {
proxy_pass http://localhost:3000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment