小编Ric*_*lch的帖子

在nginx中无法直接访问的角度路由

这是交易:我设置了最简单的nginx配置来练习角度,我配置了routeProvider来使用html5mode.到现在为止还挺好!我将基数设置为'/',我的/ view1和/ view2的链接工作正常,但只有当我在索引页面中单击这些链接时.当我尝试直接在浏览器中访问它们(或重新加载页面)时,nginx返回403禁止.这是一个简单的配置,但我找不到一个简单的解释:(

我希望以任何路由正常工作的方式设置,而不必在我的nginx site.conf中明确设置它(逐个).顺便说一下,权限很好!

这是实际的conf文件:

server {
    listen  *:80;
    server_name rbs.ang;
    root    /_dev/angularjs/app;
    index   index.html;
    charset UTF-8;

    location / {
        expires -1;
        add_header  Pragma "no-cache";
        add_header  Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
        try_files   $uri $uri/ index.html;
   }
}
Run Code Online (Sandbox Code Playgroud)

nginx angularjs

7
推荐指数
1
解决办法
3186
查看次数

从webstorm commad行工具调用npm

我刚开始在webstorm(在Windows上)grunt并且无法调用npm(节点插件已安装并启用,node.exe位于系统路径中).

npm init

什么命令行工具输出:

module.js:340
    throw err;
          ^
Error: Cannot find module 'C:\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

Process finished with exit code 8
Run Code Online (Sandbox Code Playgroud)

谢谢

windows node.js npm webstorm

4
推荐指数
1
解决办法
8626
查看次数

标签 统计

angularjs ×1

nginx ×1

node.js ×1

npm ×1

webstorm ×1

windows ×1