I started nginx on port 80 and configured it as follows, but for some reason it is not accessible from the outside.
External access is verified by cman.jp.
The router is open to port.
When I tried sudo, it came out.lsof-i:80
does not show nginx.
sudolsof-i:80
nginx39791 root6u IPv40x940c44dd2ca1aa210t0TCP*:http (LISTEN)
nginx39792 nobody6u IPv40x940c44dd2ca1aa210t0TCP*: http (LISTEN)
nginx39793 nobody6u IPv40x940c44dd2ca1aa210t0TCP*: http (LISTEN)
nginx39794 nobody6u IPv40x940c44dd2ca1aa210t0TCP*: http (LISTEN)
nginx39795 nobody6u IPv40x940c44dd2ca1aa210t0TCP*: http (LISTEN)
nginx.conf
worker_processes auto;
error_log/usr/local/etc/nginx/logs/error.log info;
events {
worker_connections1024;
}
US>http{
include mime.types;
default_type application/octet-stream;
log_format main'$remote_addr-$remote_user[$time_local]"$request"'
'$status$body_bytes_sent"$http_refer"'
'''$http_user_agent''''$http_x_forwarded_for";
access_log/usr/local/etc/nginx/logs/access.log main;
sendfile on;
keepalive_timeout65;
server{
listen* —80;
server_name hoge.example.asia;
location / {
root/Users/seioo/Devs/Web/;
index index.html index.htm;
autoindex on;
}
}
}
Superuser had a similar question.
I think the reason is that the firewall cannot be unblocked with symbolic links.
I think it will be cured if you add it manually from the setting or with the following command.
sudo/usr/libexec/ApplicationFirewall/socketfilterfw --add`readlink\`whichnginx\``
sudo/usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp`readlink\`which nginx\``
It's a bit troublesome that I have to fix it every time I upgrade the version...
© 2024 OneMinuteCode. All rights reserved.