VKzHs*KzAnpAxp*QdBW8 Posted November 6, 2019 Share Posted November 6, 2019 unRaid 6.7.2 First time unRaid user, currently on a test key however I've always wanted to host bitwarden myself. I've been watching and following this guide from u/spaceinvaderone however while he uses Nextcloud and sonarr as an example, I'm using bitwarden. Most things go to plan, Let's encrypt give my domain my own cert (Although I already own a wildcard so it would be good to just use that one if I can? however when I go to bitwarden.mydomain.com I get the ngix landing page for Let's encrypt which falls under appdata\letsencrypt\www\index.html It appears while everything works correctly with Let's Encrypt and the domain, it is not forwarding the domain to the correct port of bitwarden. I tried to edit the /appdata/letsencrypt/nginx/proxy-confs/bitwarden.subdomain.conf file with: server { listen 443; server_name bitwarden.*; include /config/nginx/ssl.conf; client_max_body_size 128M; # enable for ldap auth, fill in ldap details in ldap.conf #include /config/nginx/ldap.conf; location / { include /config/nginx/proxy.conf; proxy_pass http://172.20.55.109:8080; } location /notifications/hub { include /config/nginx/proxy.conf; proxy_pass http://172.20.55.109:8080; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } location /notifications/hub/negotiate { include /config/nginx/proxy.conf; proxy_pass http://172.20.55.109:8080; } } without luck, even after rebooting both the Let's Encrypt docker and also the server itself, this page shows up externally on my mobile when connected via LTE so the pfsense rules are working as they should, something isn't forwarding correctly. Can anyone see what's going wrong here? This happens with both nextcloud AND bitwarden, therefore it seems there is an issue with ngix within Let's Encrypt. Thinking there was an issue, I reinstalled unRaid however ran into the same issue. 1.webp 2.webp 3.webp 4.webp Quote Link to comment
ssinseeme Posted April 19, 2020 Share Posted April 19, 2020 Oh. Man no reply to this either. I think I have the same issue. Did you resolve this issue. Quote Link to comment
deadnote Posted April 19, 2020 Share Posted April 19, 2020 Hi Here is my conf for bitwarden. Make sure your bitwarden container is named "bitwarden" server { listen 443 ssl; listen [::]:443 ssl; server_name bitwarden.*; include /config/nginx/ssl.conf; client_max_body_size 128M; # enable for ldap auth, fill in ldap details in ldap.conf #include /config/nginx/ldap.conf; location / { # enable the next two lines for http auth #auth_basic "Restricted"; #auth_basic_user_file /config/nginx/.htpasswd; # enable the next two lines for ldap auth #auth_request /auth; #error_page 401 =200 /login; include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; set $upstream_bitwarden bitwarden; proxy_pass http://$upstream_bitwarden:80; } location /notifications/hub { include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; set $upstream_bitwarden bitwarden; proxy_pass http://$upstream_bitwarden:80; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } location /notifications/hub/negotiate { include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; set $upstream_bitwarden bitwarden; proxy_pass http://$upstream_bitwarden:80; } } Quote Link to comment
ssinseeme Posted April 19, 2020 Share Posted April 19, 2020 #BITWARDEN # make sure that your domain has dns has a cname or a record set for the subdomain bitwarden # This config file will work as is when using a custom docker network the same as letesencrypt (proxynet). # However the container name is expected to be "bitwardenrs" as it is by default the template as this name is used to resolve. # If you are not using the custom docker network for this container then change the line "server bitwardenrs:80;" to "server [YOUR_SERVER_IP]:8086;" Also remove line 7 resolver 127.0.0.11 valid=30s; upstream bitwarden { server bitwardenrs:80; } server { listen 443 ssl; server_name mynamebitwarden.*; include /config/nginx/ssl.conf; client_max_body_size 128M; location / { proxy_pass http://bitwarden; 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; } location /notifications/hub { proxy_pass http://bitwarden; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /notifications/hub/negotiate { proxy_pass http://bitwarden; } } This is what Spaceinvadore shared, it looks different than your config file. I only changed the subdomain as you see. it is added to duckdns and letencript my bitwarden container name is bitwardens as default. should i just copy and past your configuration? of course i will change the subdomain and will change the container to bitwarden instead. Quote Link to comment
deadnote Posted April 20, 2020 Share Posted April 20, 2020 I took the default file from letsencrypt\nginx\proxy-confs\bitwarden.subdomain.conf.sample, renamed it bitwarden.subdomain.conf and rename my image docker name from bitwardenrs to bitwarden. Did you create a custom netowrk as it's explained in the spaceinvader video ? Do you opened the ports in your router ? Does it work for another container ? Quote Link to comment
ssinseeme Posted April 20, 2020 Share Posted April 20, 2020 I opened port 80 and 443 just like he showed in video. Is there another port to open? I tried your config file. Changed the name of the docker as you instructed. It still not working. I have my Nextcloud working, at least it created an Https with duckdns and I can access from out side. Although there is errors in next cloud about rever proxy I don’t know what it means. anyway. Is your bitwarden works fine using your domain. Quote Link to comment
deadnote Posted April 20, 2020 Share Posted April 20, 2020 No need for others ports. Yes, my bitwarden works with my domain. What video tutoriel did you follow ? Quote Link to comment
ssinseeme Posted April 20, 2020 Share Posted April 20, 2020 I followed Spaceinvador’s YouTube video step by step. The only difference I am seeing reading the forum and space invader is that I am using DuckDns to creat my subdomain and I guess everyone else is using their payed domain. duckdns is setup right and running on unraid letencrypt running with no error and the config file is set up with the subdomain. I don’t know what else I am missing. Quote Link to comment
deadnote Posted April 22, 2020 Share Posted April 22, 2020 On spaceinvader vido, bitwarden image is running on a "proxynet" network. Did you follow this step ? Quote Link to comment
ssinseeme Posted April 24, 2020 Share Posted April 24, 2020 (edited) Hi deadnote, first thanks for trying to help me. i decided to have my own domain to try and see if bitwarden would work. i will write all the steps and please let me know if i am missing something. first, I know that Letenrypt is set up right with my domain name and subdomains, the log connected to all my 2 subdomain Nextcloud, bitwarden. see image. made sure the Cnam is set right spelled right... Second, my duckdns is set up right since my Nextcloud is working following Spaceenvador's Video for Bitwarden, yes i set up the network to custom, just like Nextcloud. I tried 2 different config files in letencryp for bitwarden, one with spaceinvador file and i left the container name as original with bitwardenrs of course i alway restart my dockers. #BITWARDEN # make sure that your domain has dns has a cname or a record set for the subdomain bitwarden # This config file will work as is when using a custom docker network the same as letesencrypt (proxynet). # However the container name is expected to be "bitwardenrs" as it is by default the template as this name is used to resolve. # If you are not using the custom docker network for this container then change the line "server bitwardenrs:80;" to "server [YOUR_SERVER_IP]:8086;" Also remove line 7 resolver 127.0.0.11 valid=30s; upstream bitwarden { server bitwardenrs:80; } server { listen 443 ssl; server_name bitwarden.*; include /config/nginx/ssl.conf; client_max_body_size 128M; location / { proxy_pass http://bitwarden; 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; } location /notifications/hub { proxy_pass http://bitwarden; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /notifications/hub/negotiate { proxy_pass http://bitwarden; } } second i tried you config which is the same as what was in letenrypt and change .sample to .conf and i change the container name to bitwarden. # make sure that your dns has a cname set for bitwarden and that your bitwarden container is not using a base url # make sure your bitwarden container is named "bitwarden" server { listen 443 ssl; listen [::]:443 ssl; server_name bitwarden.*; include /config/nginx/ssl.conf; client_max_body_size 128M; # enable for ldap auth, fill in ldap details in ldap.conf #include /config/nginx/ldap.conf; location / { # enable the next two lines for http auth #auth_basic "Restricted"; #auth_basic_user_file /config/nginx/.htpasswd; # enable the next two lines for ldap auth #auth_request /auth; #error_page 401 =200 /login; include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; set $upstream_app bitwarden; set $upstream_port 80; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; } location /notifications/hub { include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; set $upstream_app bitwarden; set $upstream_port 80; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } location /notifications/hub/negotiate { include /config/nginx/proxy.conf; resolver 127.0.0.11 valid=30s; set $upstream_app bitwarden; set $upstream_port 80; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; } } now the weird part. when i use http://bitwarden.mydomain.com it will direct me to nextcloud i don't understand why?, when i stop nextcloud and try again i have error 502 Bad Gateway nginx/1.16.1 i am able only to connect locally with bitwarden i dont know what am i missing. this was the same using duckdns as domain Edited April 24, 2020 by ssinseeme name Quote Link to comment
deadnote Posted April 26, 2020 Share Posted April 26, 2020 Hi @ssinseeme I have no more ideas. Can you upload your screenshots ? I can't see them Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.