nginx - Synology DSM 上的 Nginx 反向代理在更新到 DSM 6.2.2 Update 3 后停止工作
问题描述
在 Reddit 上的这篇文章之后,我有一个带有自定义设置的 DS415+,用于在 Docker 容器中运行的多个服务的反向代理。在我更新到 DSM 6.2.2 Update 3 之前,一切都运行良好。从那时起,尝试访问这些服务会导致超时,尽管 curl-ing localhost:port 或 DiskStation_LAN_address:port 工作正常。
我尝试从 LetsEncrypt 更新证书,一次取出一些选项,通过以下方式清除连接:
proxy_set_header Connection "";
没有任何效果...
这是我的自定义 server.conf 文件:
server {
listen 80;
listen [::]:80;
server_name XXXXXXX.XXXXXXXX.XXX;
# Include this if you want to get a letsencrypt certificate for the domain you're using
location ^~ /.well-known/acme-challenge/ {
auth_basic off;
root /var/lib/letsencrypt;
default_type "text/plain";
}
# Include this if you want to automatically redirect to HTTPS
location / {
return 301 https://XXXXXXX.XXXXXXXX.XXX$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name XXXXXXX.XXXXXXXX.XXX;
large_client_header_buffers 4 32k;
# Include these if you want to use a specific certificate,
# you'll need to find the location of the letsencrypt after you get it...
# so this might need to be updated afterwards
ssl_certificate /usr/syno/etc/certificate/_archive/XXXXXX/fullchain.pem;
ssl_certificate_key /usr/syno/etc/certificate/_archive/XXXXXX/privkey.pem;
# add_header Strict-Transport-Security "max-age=15768000; includeSubdomains; preload" always;
# Include this if you want basic authentication required
# auth_basic “Restricted”;
# auth_basic_user_file /etc/nginx/.htpasswd;
# Sonarr, requires Sonarr update webhome configuration to match
location /sonarr {
proxy_set_header Host $http_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_set_header Connection "";
proxy_intercept_errors on;
proxy_http_version 1.1;
proxy_pass http://localhost:8989;
proxy_redirect default;
}
}
有没有人有任何建议来诊断超时发生的原因,并希望有一个解决方案?正如我所说,服务正在运行,可以使用 NAS 地址+端口访问,但不能从外部访问。nginx 是 1.15.7 版本。提前谢谢了!
解决方案
我觉得很愚蠢……结果,无论出于何种原因,我路由器上的端口转发规则已重置。一旦我恢复它们,一切都运行良好。
推荐阅读
- css - Ioslides_presentation 没有在运行时使用自定义 css shiny_prerendered
- ios - 如何根据数组值获取索引
- r - 通过 lapply 提取包含多个数据框的列表的值,条件是数据框的特定列为正?
- ios - cellForRowAt:更改选项卡时返回 nil
- php - 在 PHP 中提取 chmod 文件权限
- python - 如何使用正则表达式从文件名中提取日期
- amazon-web-services - 如何编写aws dynamodb扫描过滤器
- javascript - JavaScript 转义不受信任的数据以防止 XSS
- javascript - 我如何从待处理的承诺中获取价值?
- python - 如何有条件地合并数据框列