node.js - Issue on LEMP configuration and how can i redirect to NodeJS request to NGINX -
i configured lemp server on ubuntu nodejs i'm getting following error on browser.
"the page looking temporarily unavailable
.
please try again later." how can redirect nodejs request nginx .can please me how can sort out these issues.
if nginx work through php-fpm (fastcgi process manager) can uncomment important part php location ~ \.php$ {} stanza in default vhost defined in file
vi /etc/nginx/sites-available/default
like
[...] location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } [...]
and nodejs can modify same vhost file
vi /etc/nginx/sites-available/default
and add lines below location ~ \.php$ {} stanza like
[...] location /testapp/ { proxy_pass http://localhost:3000/; proxy_set_header host $host; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; } [...]
from can forwarding port node.js app nginx
now can access page url http://localhost/testapp/ instead of http://localhost:3000/
hope work you
Comments
Post a Comment