无法使用nginx在本地运行index.html

时间:2018-01-13 19:11:03

标签: nginx

我的配置设置如下。

nginx.config 我已将include conf.d/*.conf;包含在文件的底部。

demoSite.config

server {
    listen       80;
    server_name  dev.local.com;

    location / {
        root   /Users/nikhilwali/Documents/Project/threejs_Demo/;
        index  index.html;
    }

    location = /favicon.ico {
        return 204;
        access_log     off;
        log_not_found  off;
    }

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}

宿主

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost 

127.0.0.1   dev.local.com

当我跑sudo nginx

Error: 403 Forbidden

0 个答案:

没有答案