Skip to content

Instantly share code, notes, and snippets.

@fais3000
Created February 12, 2017 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fais3000/b16b087572a5d6d54d037c517277204d to your computer and use it in GitHub Desktop.
Save fais3000/b16b087572a5d6d54d037c517277204d to your computer and use it in GitHub Desktop.
Nginx Vhost settings for setting up server to serve PHP and Nodejs apps together
server {
listen 80;
server_name craftypixels.com;
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