• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Websockets not working in Docker

Igcorreia

New Pleskian
Server operating system version
Ubuntu 22
Plesk version and microupdate number
Plesk Obsidian Version 18.0.53 Update #2,
Hey Plesk team, could you please create a tutorial about setting up a docker container with an app that uses WebSocket? It looks like a lot of people are requesting this. I am always reached by the community because nobody can. Here is another ticket just about this.

Can you please install the platform base row/base row from scratch and get the WebSocket working?

My usual steps are:
  1. Create a domain/subdomain
  2. Add the DNS configuration internal/external
  3. Download baserow/baserow container
  4. Run an unconfigured instance
  5. Please wait for it to finish
  6. Open the suggested port either it works or not
  7. Visit the domain and map the docker port
  8. Stop the instance
  9. Edit the instance, make the port fixed, and map the volumes
  10. Run it again to test it
  11. Stop it again
  12. Read the platform documentation to learn about the ENV variables you can use
  13. Apply the ENV in the instance
  14. Run it again
At this point, we have the following:
  1. A custom domain
  2. With a docker app mapped to the port
  3. A docker app running and storing the data locally
The problem is that the Websocket usually doesn't work. I have to waste hundreds of hours fighting Plesk configurations to make it work, like a disabling proxy, adding some headers, using Apache, etc. 90% of the time, I am unlucky.

Plesk experts could give us a clear tutorial that we can use for Websocket / Realtime-based applications. Because, right now, all of the are! Many thanks in advanced. You guys are awesome.

After installing it you will notice the following error:

1687390852565.png
 
It looks like a lot of people are requesting this. I am always reached by the community because nobody can.
Hi @Igcorreia, thank you for posting and your detailed explanation. Creating such tutorials or modifying the software can trigger significant costs. For that reason I am asking if you could please clarify a few things.

I was wondering how many are "a lot of people" for you and who these people are?

I also understand you are being reached by the community, and as you are a new poster on here, I am wondering which community that is and what your role in that community is?
 
@Peter Debik, thanks for reaching out. We just need an example of what configuration we need to do on a domain that would enable WebSockets.
The communities are N8N, Baserow, UptimeKuma, and a few more. All of this software doesn't work on Plesk, and this creates a problem for a lot of users.
I think it is extremely important for Plesk to help us. Everyone is going to competitors and cloud providers because we can't find a solution in Plesk.
Does this answer :)?
 
@Peter Debik, your intention was only to know about lots of users not actually help me, correct?
If that is the case can you please let me know, so I can find another way to help myself?
 
My intention was to understand the scope of your request. Plesk already has extensive documentation such as the official online manual and the Knowledge Base. Creating a specific guide for a purpose will be easier to justify if the request is based on a large user base. That is why I asked for the number of users. As no other forum member has posted to this thread I assume that none have the experience or that we don't yet get the issue itself.

In this case I can only recommend to open a Plesk support ticket for your individual case. Support staff will then most likely come up with a reproducible step-by-step solution for the question.

To sign-in to support please go to https://support.plesk.com

If you experience login issues, please see this KB article:
https://support.plesk.com/hc/en-us/...rt-plesk-com-and-password-reset-does-not-work

If you bought your license from a reseller, your reseller should provide support for you. If the reseller does not provide support, here is an alternative:
https://support.plesk.com/hc/en-us/articles/12388090147095-How-to-get-support-directly-from-Plesk-
 
Hey Plesk team, could you please create a tutorial about setting up a docker container with an app that uses WebSocket? It looks like a lot of people are requesting this. I am always reached by the community because nobody can. Here is another ticket just about this.

Can you please install the platform base row/base row from scratch and get the WebSocket working?

My usual steps are:
  1. Create a domain/subdomain
  2. Add the DNS configuration internal/external
  3. Download baserow/baserow container
  4. Run an unconfigured instance
  5. Please wait for it to finish
  6. Open the suggested port either it works or not
  7. Visit the domain and map the docker port
  8. Stop the instance
  9. Edit the instance, make the port fixed, and map the volumes
  10. Run it again to test it
  11. Stop it again
  12. Read the platform documentation to learn about the ENV variables you can use
  13. Apply the ENV in the instance
  14. Run it again
At this point, we have the following:
  1. A custom domain
  2. With a docker app mapped to the port
  3. A docker app running and storing the data locally
The problem is that the Websocket usually doesn't work. I have to waste hundreds of hours fighting Plesk configurations to make it work, like a disabling proxy, adding some headers, using Apache, etc. 90% of the time, I am unlucky.

Plesk experts could give us a clear tutorial that we can use for Websocket / Realtime-based applications. Because, right now, all of the are! Many thanks in advanced. You guys are awesome.

After installing it you will notice the following error:

View attachment 23640
Hi Igcorreia, i'm facing the same issue. Have you found any solution for it?
 
@Peter Debik and @deno I think I found a solution, but I need to hack the nginx.conf file inside the /system/domain/conf folder.

@Peter Debik what is the correct way to add 3 rules to the following:

1690800825455.png
Is there a way to add it in the domain settings without accessing the server?

1690800878576.png

Plesk does not allow me to either use:

Test 01 - does not work:
location ~ ^/.* {
proxy_set_header Connection 'upgrade';
proxy_set_header Upgrade $http_upgrade;
proxy_http_version 1.1;
}
or

Test 02 - is not possible:

server{
location ~ ^/.* {
proxy_set_header Connection 'upgrade';
proxy_set_header Upgrade $http_upgrade;
proxy_http_version 1.1;
}
}

1690801049824.png
It only works if I edit the file, and restart nginx.
Can the Plesk team help? I have the Linux solution, but not the Plesk solution.
 
To add content to the "http" section, please simply create a file with the desired instructions and place it into /etc/nginx/conf.d.

To modify the nginx main server.conf section you need to create custom webserver configuration templates as described in
 
@Peter Debik, I love your idea. But I have downloaded all of the vhosts default files and I can't find where that line of code should be edit. And I think the Docker Extension is making an override. Is that possible?
 
I need help please. There is not easy tutorial to follow. And I think the Docker Extension is adding the code on bullet number 3 from the image.
 
I think I already mentioned official Plesk support, but just in case:

To sign-in to support please go to https://support.plesk.com

If you experience login issues, please see this KB article:
https://support.plesk.com/hc/en-us/...rt-plesk-com-and-password-reset-does-not-work

If you bought your license from a reseller, your reseller should provide support for you. If the reseller does not provide support, here is an alternative:
https://support.plesk.com/hc/en-us/articles/12388090147095-How-to-get-support-directly-from-Plesk-
 
I think I already mentioned official Plesk support, but just in case:

To sign-in to support please go to https://support.plesk.com

If you experience login issues, please see this KB article:
https://support.plesk.com/hc/en-us/...rt-plesk-com-and-password-reset-does-not-work

If you bought your license from a reseller, your reseller should provide support for you. If the reseller does not provide support, here is an alternative:
https://support.plesk.com/hc/en-us/articles/12388090147095-How-to-get-support-directly-from-Plesk-
@Peter Debik You already asked recommended to open a Plesk support ticket for this individual case on the basis, that this is an individual issue and that no other users have posted to this. My search for the same solution contradicts your statement, yet you refer to support.

I would be grateful if you could provide a solution here. This would allow any (paying!) user to solve this problem without having to contact support directly.

My understanding is that this is the main reason for such forums, but perhaps I'm wrong.
 
@Peter Debik seems you are misunderstanding something. I never said i have found a solution elsewhere.
You stated before: "As no other forum member has posted to this thread I assume that none have the experience or that we don't yet get the issue itself."

Still, there is me searching for a solution as well as i'm facing exactly the same issue. This is what contradicts your statement and this is what i said.

If all users asking question should contact the support instead of researching and solve issues themselves, the support would definitely have a problem. Also, I don't know what this forum is about then.
 
Thank you for your opinion, it is much appreciated, although I do not see how this helps in solving the technical issue. But anyway, if you believe that it can be solved this way, I'll be happy to accept this.
 
@Igcorreia I encountered no issues with webSockets when using Baserow behind Nginx on a Plesk server.

I followed these steps:
  1. Create a (sub)domain in Plesk (baserow.example.com)
  2. Issue/install a SSL certificate for domain
  3. Install Plesk Docker extension
  4. Run latest Baserow/Baserow docker Image via Plesk Docker extension
    • Added BASEROW_PUBLIC_URL variable to settings with value https://baserow.example.com
      (Notice use of HTTPS in URL)
    • Manual mapped port 3001 to port 80
  5. In domain Apache & nginx Settings disable Proxy mode and click save
  6. After Proxy mode is disabled add the following additional Nginx directives
NGINX:
# Upgrade websocket requests and route the api backend
    location ~ ^/(api|ws)/ {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://baserow.example.com:3001;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_http_version 1.1;
        proxy_pass http://baserow.example.com:3001;
    }
Notice how the proxy_pass value points to the HTTP domain with the port used in the Docker mapping.

Hope this helps you too.
 
Last edited:
@Kaspar your suggestion is not possible. We cannot use the "location /" inside the apache and NGINX. I have 20 Plesk servers and I never manage to use "location /". Any suggestion?

I am still trying your suggestion....

1692306223900.png
 
You can, but you'll first have to disable Proxy mode and click the Apply button and then you can use "location /" in the additional Nginx directives.
 
Back
Top