Os system of ecs server :ubuntu. Os of my computer:win10. I deployed my web project to my ecs server. I could access my project online until I installed the ufw on my ecs server. I configured the firewall using ufw command and the configuration showed as below. When I visited my project ,it showed "I can't access this website".
root@....:~# ufw status
Status: active
To Action From
-- ------ ----
3306 ALLOW Anywhere
80 ALLOW Anywhere
8080 ALLOW Anywhere
23 ALLOW Anywhere
443 ALLOW Anywhere
3306 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)
23 (v6) ALLOW Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
When i visited my project using my win10 computer,it showed "I can't access this website".Then I click the "windowns network diagnosis".It said"The remote computer is not accepting connections on port 80, either due to firewall or security policy settings, or because the service may be temporarily unavailable. Windows can't find any problems with the computer's firewall." But the 80 port is open!So ,Where is the problem? Here is the nginx configuration after I excute the command "nginx -T":
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/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 /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
#include /etc/nginx/conf.d/*.conf;
server{
listen 80;
location /{
root /usr/local/nginx/html;
index index.html;
}
location /api/ {
proxy_pass http://127.0.0.1:8080/;
}
}
}
Thank you for your suggestions.I will wait online.