Nginx nodejs在windows中的同一个端口上

时间:2016-08-24 03:33:26

标签: node.js nginx windows-10

How to run Nginx with Node.js on Windows?已经回答了这个问题。然而,接下来似乎没有用。然后我去了http://nginx.org/en/docs/windows.html那里没什么帮助。这是关于我的问题的简要说明。

jxcore正在http://localhost:3434/上运行并成功提供测试文件hello.js

端口80上的Nginx正常工作。

因此,为了重定向,我已经按照上面的url进行操作,下面是我当前的配置。

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 as well but didn't work
    }

    location /pubsub { #node js files are in a sub directory under nginx root
        proxy_pass http://localhost:3434;
    }
}

重新启动nginx并转到localhost后,它会提供静态文件。但是当我去localhost / pubsub它只给403禁止。它说一个权限问题但是在windows中配置nginx时,它无处可说你需要插入权限,就像在* nix安装中一样?

0 个答案:

没有答案