nginxconfig.io 生成的配置没法正确运行啊

2021-10-12 17:59:26 +08:00
 ciki
我的需求是通过 nignx 反代多个 docker 里运行的不同端口 server,同时 nginx 还当静态服务器支撑几个 vue 的前端项目。目前的做法是通过负载均衡来实现反代,但是静态服务配置超过两个就会导致无法访问。所以用 nginxconfig.io 去生成了一个配置对比看看,发现它的配置比较呆板,而且放到服务器后访问会直接拒绝。
1288 次点击
所在节点    NGINX
2 条回复
GTim
2021-10-12 19:06:42 +08:00
贴出你的配置,我来帮你解决
ciki
2021-10-13 10:14:33 +08:00
@GTim https://www.digitalocean.com/community/tools/nginx#?domains.0.server.domain=api.mydomain.com&domains.0.server.documentRoot=&domains.0.server.redirectSubdomains=false&domains.0.https.certType=custom&domains.0.https.sslCertificate=%2Fetc%2Fnginx%2Fcerts%2Fapi.mydomain.com%2Fcert.pem&domains.0.https.sslCertificateKey=%2Fetc%2Fnginx%2Fcerts%2Fapi.mydomain.com%2Fkey.pem&domains.0.php.php=false&domains.0.reverseProxy.reverseProxy=true&domains.0.reverseProxy.proxyPass=http%3A%2F%2F127.0.0.1%3A8088&domains.0.routing.index=index.html&domains.0.routing.fallbackHtml=true&domains.0.routing.fallbackPhp=false&domains.0.logging.accessLog=true&domains.0.logging.errorLog=true&domains.1.server.domain=dev-api.mydomain.com&domains.1.server.documentRoot=&domains.1.server.redirectSubdomains=false&domains.1.https.certType=custom&domains.1.https.sslCertificate=%2Fetc%2Fnginx%2Fcerts%2Fdev-api.mydomain.com%2Fcert.pem&domains.1.https.sslCertificateKey=%2Fetc%2Fnginx%2Fcerts%2Fdev-api.mydomain.com%2Fkey.pem&domains.1.php.php=false&domains.1.reverseProxy.reverseProxy=true&domains.1.reverseProxy.proxyPass=http%3A%2F%2F127.0.0.1%3A8080&domains.1.routing.index=index.html&domains.1.routing.fallbackHtml=true&domains.1.routing.fallbackPhp=false&domains.1.logging.accessLog=true&domains.1.logging.errorLog=true&domains.2.server.domain=admin.mydomain.com&domains.2.server.path=%2Fdata%2Fwww%2Fadmin.mydomain.com&domains.2.server.documentRoot=%2F&domains.2.server.redirectSubdomains=false&domains.2.https.certType=custom&domains.2.https.sslCertificate=%2Fetc%2Fnginx%2Fcerts%2Fadmin.mydomain.com%2Fcert.pem&domains.2.https.sslCertificateKey=%2Fetc%2Fnginx%2Fcerts%2Fadmin.mydomain.com%2Fkey.pem&domains.2.php.php=false&domains.2.routing.index=index.html&domains.2.routing.fallbackHtml=true&domains.2.logging.accessLog=true&domains.2.logging.errorLog=true&global.https.ocspCloudflare=false&global.https.ocspGoogle=false&global.https.ocspOpenDns=false&global.https.letsEncryptCertRoot=%2Fetc%2Fnginx%2Fcerts%2F&global.logging.logNotFound=true&global.logging.cloudflare=true&global.logging.xForwardedFor=true&global.logging.trueClientIp=true&global.nginx.user=root&global.app.lang=zhCN

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/807371

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX