Couchdb与SSL和Nginx反向IP

2sbarzqh  于 2023-10-14  发布在  CouchDB
关注(0)|答案(1)|浏览(178)

我有一个包含CouchDB的Docker容器,我想将它与我在Cloudflare中的域链接,以便使用SSL确保连接安全,因此,我可以使用Nginx来使用CouchDB容器的domin反转droplet的IP,或者更好地为SSL配置CouchDB。

ncecgwcz

ncecgwcz1#

1-创建液滴。2-docker-compose.yml for CouchDB.

version: '3'
services:
couchserver:
image: bitnami/couchdb
restart: always
ports:
- "5984:5984"
environment:
- COUCHDB_USER=admin
- COUCHDB_PASSWORD=pass
volumes:
- ./dbdata:/opt/couchdb/data

-docker-compose up
3-将域名与Cloudflare链接并创建SSL。4-将液滴与域连接。5-使用Nginx来反转域中水滴的IP。6-安装NGINX(不是droplet本身的容器)并配置。sudo apt install nginx 8-and Change nginx config file. 7-sudo nano /etc/nginx/sites-available/default

# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name yourdomain.com www.domain.com;
location / {
proxy_pass http://68.183.5.130:5984; #whatever port your app runs on
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
#pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;

最后,您的连接将是:(https://username: [[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection) /yourDB

相关问题