NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
23.08k stars 2.68k forks source link

nginx-proxy-manager not working with custom VH (for cryptpad) #533

Open BetterToAutomateTheWorld opened 4 years ago

BetterToAutomateTheWorld commented 4 years ago

Hi,

First of all, thank you very much for nginx-proxy-manager, it's such a great tool !

What is troubling you?

Adapt the proper configuration for nginx-proxy-manager to be able to work with cryptpad docker container (it's not a cryptpad issue, it's a nginx configuration issue)

I want to get cryptpad container working with nginx-proxy-manager

Networking flow : FQDN port 80/443 > nginx-proxy-manager frontend > redirecting to 192.168.0.201:54926 > cryptpad container > running on 127.0.0.1:3000

More details about the issue

cryptpad is started and working.

curl :

curl -k https://192.168.0.201:54926
curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

docker logs on the container :

FRESH MODE ENABLED
[2020-07-31T07:14:34.813Z] server available http://0.0.0.0:3000

But some issues are met from a template.js script : image In my web browser I've a white page instead of cryptpad.

Browser console error : image

The Nginx configuration inside nginx-proxy-manager is pretty much a copy and paste of the cryptpad configuration with my values & adapted to nginx-proxy-manager way of working : https://pastebin.com/6Bg18Hjf and the Nginx full VH is : https://pastebin.com/0xjdFzCB

I checked the 2 includes, include custom is empty, and include proxy contains :

  location / {                                                                                               
    add_header       X-Served-By $host;                                                                      
    proxy_set_header Host $host;                                                                             
    proxy_set_header X-Forwarded-Scheme $scheme;                                                             
    proxy_set_header X-Forwarded-Proto  $scheme;                                                             
    proxy_set_header X-Forwarded-For    $remote_addr;                                                        
    proxy_pass       $forward_scheme://$server:$port;                                                                   
  }

I even tried to simplify the Nginx config(manually, without GUI), but I've still an issue with the **template.js*** access, but it shouldn't be the case, i can see the proper config ...

If anyone can help, it would be really appreciated, it seems like I miss something which is overwriting some parameters in the VH, and crash the template.js script from cryptpad, which should be normally accessible and working... :(

Any help appreciated, thank you !

Hajibey commented 1 year ago

Sorry to necrobump, but did you ever manage to make Cryptpad work with NPM?

binerf commented 1 year ago

On my side, I've created 2 hosts in NPM (declared in my DNS) pointing the same cryptpad container on port 3000.

In the cryptpad config.js file I've setup:

[...]
    httpUnsafeOrigin: "https://cryptpad_first.mydomain.com",
[...]
     httpSafeOrigin: "https://cryptpad_second.mydomain.com",
[...]
    httpAddress: '::',
[...]

And it works.

github-actions[bot] commented 7 months ago

Issue is now considered stale. If you want to keep it open, please comment :+1: