Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jwilder/nginx-proxy #348

Closed
adi90x opened this issue Nov 15, 2016 · 4 comments
Closed

Jwilder/nginx-proxy #348

adi90x opened this issue Nov 15, 2016 · 4 comments

Comments

@adi90x
Copy link

adi90x commented Nov 15, 2016

Hello,
It seems that portainer is not working out of he box with jwilder/nginx-proxy.
It seems that location /ws should be set up in the reverse proxy for portainer being able to get data, am I correct?
Does anyone have a working config with jwilder/nginx proxy? Or any clue of how to set everything?
Regards

@thojkooi
Copy link
Contributor

Hi @adi90x

I've got portainer running behind jwilder/nginx-proxy.

Here is what I've done to set it up:

  • Standard set up as per jwilder/nginx-proxy documentation (environment variable etc)
  • Add a location configuration file for portainer

If you take a look at this page: https://portainer.readthedocs.io/en/latest/faq.html#how-can-i-configure-my-reverse-proxy-to-serve-portainer

You will notice that the /portainer/ws/ location has some extra configuration. If you leave those out, you will get (at least in my case) an error message 'persistent connection closed' when attempting to accesss the portainer API.

I've added the following to my proxy configuration to solve that:

In /etc/nginx/vhost.d/portainer.myhostname.example_location:

proxy_http_version 1.1;
proxy_set_header Connection "";

See here for the jwilder/nginx-proxy documentation about the location file.

I don't know if there is a better way, but this does work for me.

@adi90x
Copy link
Author

adi90x commented Nov 17, 2016

Perfectly working ! Thanks a lot for the information !

@adi90x adi90x closed this as completed Nov 17, 2016
@ghost
Copy link

ghost commented Jan 20, 2017

If you want web tty console to work, you must add this lines in the previous file :

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

Note: you can also replace :

proxy_http_version 1.1;
proxy_set_header Connection "";

with this simple line: proxy_set_header Connection $http_connection;.

@ovizii
Copy link

ovizii commented Apr 20, 2017

This solution contradicts: nginx-proxy/nginx-proxy#705

here is suggested to use

└── vhost.d
└── app.mydomain.com_location

while the other linked issue suggests to use:

└── vhost.d
└── app.mydomain.com

None of these two work for me. After reading https://portainer.readthedocs.io/en/latest/faq.html#how-can-i-configure-my-reverse-proxy-to-serve-portainer it looks like one also needs to add another location:

  location /portainer/api/websocket/ {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_http_version 1.1;
      proxy_pass http://portainer/api/websocket/;
  }

Could someone clarify how to add this via the proxy?

ArrisLee pushed a commit that referenced this issue Jun 8, 2021
* feat(git): update git checkout [EE-630] (#348)

* feat(git): Add Azure DevOps exception [EE-631] (#356)

* feat(git): refactoring git package (#631)

* feat(git): azure parse https url (#631)

* feat(git): unit-test refactoring (#631)

* feat(git): azure parse urls (#631)

* feat(git): extract azure module (#631)

* feat(git): azure service functions (#631)

* feat(git): azure, git refactoring and tests (#631)

* feat(archive): add unzip file tests (#631)

* feat(git): PR review changes (#631)

* feat(git): error handling updates (#631)

* feat(git): error handling updates (#631)

* feat(archive): test refactoring (#631)

Co-authored-by: Dennis Buduev <dennis.b@clubware.co.nz>

* feat(git) remove .git directory (#451)

* feat(git): return git clone error (#630)

Co-authored-by: Dennis Buduev <dennis.b@clubware.co.nz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants