![如何修复我的 URL 的 ERR_EMPTY_RESPONSE](https://linux22.com/image/720970/%E5%A6%82%E4%BD%95%E4%BF%AE%E5%A4%8D%E6%88%91%E7%9A%84%20URL%20%E7%9A%84%20ERR_EMPTY_RESPONSE.png)
我有这个域名backtocart.co在 godaddy 上。我有这个子域名 -app.backtocart.co
每当我访问该子域名时我都会收到浏览器响应
app.backtocart.co didn’t send any data. ERR_EMPTY_RESPONSE
这是来自 godaddy 的 dns 配置。
如您所见,根指向与子域不同的 IP。145.239.24.196
我有 nginx 服务器。chatservice.backtocart.co也在 nginx 上,但它工作正常,我得到了 nginx 响应。我的 nginx 配置似乎也很好。以下是配置
#proxy_cache_path /home/html_catch levels=1:2 keys_zone=appbacktocartcocatch:2m max_size=50m;
#proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args";
#proxy_cache_valid 200 302 10m;
#proxy_cache_valid 404 1m;
upstream appbacktocartco {
# server localhost:3000;
server localhost:3001;
}
server {
listen 145.239.24.196:80;
server_name app.backtocart.co;
location / {
proxy_cache appbacktocartcocatch;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://appbacktocartco;
proxy_read_timeout 90;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/app.backtocart.co/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/app.backtocart.co/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
}
以下是 nginx 的常规配置
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
proxy_cache_path /home/html_catch levels=1:2 keys_zone=appbacktocartcocatch:2m max_size=50m;
proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args";
proxy_cache_valid 200 302 10m;
proxy_cache_valid 404 1m;
include /etc/nginx/sites-enabled/*.conf;
}
答案1
检查 Nginx 日志后发现,没有更多可用空间root
。清理空间后,问题解决了。
答案2
我希望我能对此提供不同的看法。我遇到了同样的问题,但我的解决方案是通过防火墙接受端口 80 上的流量。