Created
February 12, 2017 13:26
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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