我正在用 Shibby FW 的 Tomato 配置我的家用路由器 ASUS N18U。我想在上面设置一个家庭网络服务器 NGINX。我知道,这并不理想。我唯一的问题是我无法从 Wan 访问服务器。此外,我有动态 IP,我已经通过 DDNS 服务解决了这个问题。如果我想访问路由器或 SFTP 的配置页面,或者当我输入 myddnsdomain 并且我在 LAN 内时,它工作正常。我在我的调制解调器上打开了端口 80(来自 ISP)并将下面的代码添加到路由器(ASUS N18U)配置中,我不能只在管理菜单中端口转发它,因为它只允许转发到局域网(我的网络服务器在“路由器”上)。
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -I 输入 -p tcp --dport 80 -j 接受
iptables -t filter -A INPUT -p tcp --dport 80 -j ACCEPT
这些都没有解决我的问题。我也尝试过不同的端口。我对其进行了跟踪路由,似乎该路由器阻止了它。通过 Wan IP 访问我的服务器没有帮助。文件夹“www”不属于任何人。谢谢您的帮助
# NGinX generated config file
user nobody;
worker_processes 1;
worker_cpu_affinity 0101;
master_process off;
worker_priority 10;
error_log /tmp/var/log/nginx/error.log;
pid /tmp/var/run/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 512;
}
http {
include /tmp/etc/nginx/mime.types;
include /tmp/etc/nginx/fastcgi.conf;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
client_max_body_size 100M;
server {
listen 80;
server_name mydynamicdomain.net;
access_log /tmp/var/log/nginx/access.log main;
location / {
root /tmp/mnt/CORSAIR/www;
index index.html index.htm index.php;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location /50x.html {
root /tmp/mnt/CORSAIR/www;