V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  maxAir  ›  全部回复第 2 页 / 共 2 页
回复总数  31
1  2  
@wednesdayco 嗯,🤦‍ 还没填过 docker 的坑, 去了解一下
@aaa5838769 google 百度, 都百度好久了, 被这个问题困扰几天了, 该试都都试了,🤦‍♂️
@kidlj
1. 注释掉 user root owner,
2. 执行 brew services start nginx,
提示:XLdeMacBook-Pro:~ xl$ brew services start nginx
==> Successfully started `nginx` (label: homebrew.mxcl.nginx),
启动后, 还是不行,同样报 403
2019-07-08 17:45:41 +08:00
回复了 sivacohan 创建的主题 V2EX “报告这个主题”有什么用?类似什么举报xx的功能吗?
同问。。。。
@kidlj 其实只有第一个打开的哈, 我把代码贴上来, 不知道咋把前面的 注释 “#” 给弄没了, 而且字号还变大了, 我再贴一遍试试。

user root owner;
# user root xl;
# user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

upstream node_server{
server 127.0.0.1:3000;
keepalive 2000;
}
server {
listen 80;
server_name localhost;

location / {
root /Users/xl/work/;
index index.html index.htm;
# add_header Access-Control-Allow-Origin *;
# add_header Cache-Control max-age=3600;
# concat on;
# concat_max_files 100;
# concat_types "application/javascript" "text/css" "text/html";
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}



include servers/*;
}
@ipengxh
/Users/xl:drwxr-xr-x@ 31 xl staff 992 7 8 16:31 xl
/Users:drwxr-xr-x 5 root admin 160 4 13 21:21 Users

也是有 rwx 权限的
@wuchujie , var 目录下有日志:2019/07/08 16:40:43 [error] 5896#0: *1 directory index of "/Users/xl/work/" is forbidden, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost", 但是我查看 xl/work 目录是有 rwx 权限的, 不知道为什么了
@aaa5838769 意思是不能放在 Desktop 里面吗, 我放在 Users/xl/work 这样也是一样的效果, 访问 localhost 就直接 403 了
window 下没有问题,可以顺利访问,第一次用 mac,死活通不了
你为什么要断了两位兄弟的最后一点幻想
1  2  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2287 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 19ms · UTC 08:38 · PVG 16:38 · LAX 01:38 · JFK 04:38
Developed with CodeLauncher
♥ Do have faith in what you're doing.