node.js - Nginx nodejs on same port in windows -
this question answered in how run nginx node.js on windows?. following doesn't seem work. went http://nginx.org/en/docs/windows.html doesn't much. here brief problem.
jxcore running on http://localhost:3434/ , successful serves test file hello.js
nginx on port 80 works fine usual.
so redirected have followed above url , below current configuration.
server { listen 80; server_name localhost; access_log d:\nginx-1.10.1\logs\access.log; location ~ ^/(javascripts|stylesheets|images) { expires max; location / { root html; index index.html index.htm; #i tried adding hello.js here didn't work } location /pubsub { #node js files in sub directory under nginx root proxy_pass http://localhost:3434; } }
after restart nginx , go localhost serves static files. when go localhost/pubsub gives 403 forbidden. says permission issue when configuring nginx in windows, says need meddle permissions in *nix installations?
ok! sorted out accident! :)
initially redirection done below. idea if goes localhost/pubsub should redirect nodejs, didn't work. showing 403
location /pubsub { #node js files in sub directory under nginx root proxy_pass http://localhost:3434; }
working configuration was;
location /pubsub/ { # notice trailing slash proxy_pass http://localhost:3434; }
i added default .js file index parameter.
that's , http://localhost/pubsub goes node!
Comments
Post a Comment