# wordpress over fastcgi server { listen 81; server_name _; root /mnt/apps/airpair-blog/current; index index.html index.php /index.php; # restricting all dot files location ~ /\. { return 403; } location / { try_files $uri $uri/ /index.php?$args; } # Add trailing slash to */wp-admin requests. rewrite /wp-admin$ $scheme://$host$uri/ permanent; location ~ \.php$ { include fastcgi_params; try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; fastcgi_pass 127.0.0.1:9000; } } server { listen 80; server_name _; # Home page is node.js app location = / { proxy_pass http://airpair-com-prod.herokuapp.com; } # Node.js location /find-an-expert { proxy_pass http://airpair-com-prod.herokuapp.com; } # another node Node.js location /login { proxy_pass http://airpair-com-prod.herokuapp.com; } # rest to wordpress location / { proxy_set_header Host $proxy_host:80; proxy_pass http://127.0.0.1:81; } }