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

[bug]: problem with the work of attachments for the self-hosted server behind the NGINX proxy #5969

Open
1 task done
KondakovVE opened this issue Nov 6, 2024 · 2 comments
Assignees
Labels
🐛bug Something isn't working

Comments

@KondakovVE
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Good afternoon. I found the following problem when deploying the self-hosted server

If you use an external NGINX server for the container, there is a problem when post attachments.

As a result of analysis and debugging, it was possible to establish that the reason is in the function apiserver.plane.settings.storage.S3Storage.init

The problem is that when initializing boto3.client, the request.scheme field is passed as the url - that is, the value for nginx will be http and the generated http link is passed to the client for the subsequent method call with the attachment download. But there will be an error (so the site was opened in the user's browser using an https link)

for myself, I just explicitly prescribed the https protocol, but I think it makes sense to introduce some kind of USE_PROXY environment variable that will allow you to work it out correctly

Steps to reproduce

git clone https://github.com/makeplane/plane.git
./setup.sh

then comment service proxy and make config for external nginx

Environment

Production

Browser

Google Chrome

Variant

Self-hosted

Version

0.23.1

@KondakovVE KondakovVE added the 🐛bug Something isn't working label Nov 6, 2024
@akshat5302
Copy link
Collaborator

Hey @KondakovVE, please ensure your external proxy server is configured to set the following headers for proxied requests:

# Set headers for proxied request
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host  $host;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP         $remote_addr;
        
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        proxy_http_version 1.1;

@pushya22 pushya22 assigned gakshita and akshat5302 and unassigned vihar, pushya22 and gakshita Nov 7, 2024
@pushya22
Copy link
Collaborator

Hey @KondakovVE did the above resolution help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants