Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Nginx Vhost settings for setting up server to serve PHP and Nodejs apps together
server {
listen 80;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
location @blog {
rewrite ^/blog(.*) /blog/index.php?q=$1;
location /blog {
index index.php;
try_files $uri $uri/ @blog;
alias /var/www/craftypixels/blog;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
} }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment