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

Reverse Proxy - Apache + certbot #4168

Closed
2 tasks done
luchris opened this issue Dec 4, 2023 · 8 comments
Closed
2 tasks done

Reverse Proxy - Apache + certbot #4168

luchris opened this issue Dec 4, 2023 · 8 comments
Labels
area:deployment related to how uptime kuma can be deployed help question Further information is requested Stale

Comments

@luchris
Copy link

luchris commented Dec 4, 2023

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

📝 Describe your problem

Hi am seeing uptime-kuma is running.

tcp       84      0 0.0.0.0:3001            0.0.0.0:*               LISTEN      41346/conmon

Did a reverse proxy with certbot by adding httpd.conf

<IfModule mod_ssl.c>
SSLStaplingCache shmcb:/var/run/apache2/stapling_cache(128000)
<VirtualHost *:443>
  ServerName uptime.server.com

  Protocols h2 http/1.1

  ProxyPass / http://localhost:3001/
  RewriteEngine on
  RewriteCond %{HTTP:Upgrade} =websocket
  RewriteRule /(.*) ws://localhost:3001/$1 [P,L]
  RewriteCond %{HTTP:Upgrade} !=websocket
  RewriteRule /(.*) http://localhost:3001/$1 [P,L]

SSLCertificateFile /etc/letsencrypt/live/uptime.server.com
/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/uptime.server.com
/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
Header always set Strict-Transport-Security "max-age=31536000"
SSLUseStapling on
</VirtualHost>
</IfModule>

Apache restarted without any complaint.

But i got the below error.

Error logged as follows:-

[Mon Dec 04 11:14:13.912098 2023] [proxy_http:error] [pid 44847:tid 44970] (70007)The timeout specified has expired: [client 165.13.1.29:58861] AH01102: error reading status line from remote server localhost:3001
[Mon Dec 04 11:14:13.912494 2023] [proxy:error] [pid 44847:tid 44970] [client 165.13.1.29:58861] AH00898: Error reading from remote server returned by /

How can i trouble shoot this?

Thank you.

📝 Error Message(s) or Log

Browser displayed error

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request

Reason: Error reading from remote server

🐻 Uptime-Kuma Version

Latest docker version

💻 Operating System and Arch

Rocky 9

🌐 Browser

Google Chrome Version 119.0.6045.200

🐋 Docker Version

Podman-docker 2:4.6.1-5.el9

🟩 NodeJS Version

No response

@luchris luchris added the help label Dec 4, 2023
@CommanderStorm
Copy link
Collaborator

Your configuration is missing some configuration options from https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy#apache

Could you try the configuration with SSLEngine On?

@CommanderStorm CommanderStorm added the question Further information is requested label Dec 5, 2023
@kmbuthia
Copy link

kmbuthia commented Dec 5, 2023

Facing the exact same issue and seeing the exact same errors with the same Apache + docker + certbot setup

@CommanderStorm
Copy link
Collaborator

with the same Apache + docker + certbot setup

I don't see this setup for Apache in our docs.

So let's go at it logically.
The error message states that Apache cannot contact uptime kuma.
=> let's see if we can reproduce this:

  • what are you seeing if you visit htttps://localhost:3001 ?
  • How have you plumbed these services together? Are you using docker-compose? => please share your commands/... to reproduce this
  • Which docker network type did you use?

@kmbuthia
Copy link

kmbuthia commented Dec 6, 2023

I got this to work with the following docker-compose.yml

version: '3'

services:
  uptime-kuma:
    image: louislam/uptime-kuma:1
    container_name: uptime-kuma
    volumes:
      - ./:/app/data
    ports:
      - "3001:3001"  # <Host Port>:<Container Port>
    restart: always
    environment:
      UPTIME_KUMA_HOST: 0.0.0.0
      UPTIME_KUMA_PORT: 3001
    network_mode: "host"

volumes:
  uptime-kuma:

However I got completely stuck getting the websocket (socket.io) to work behind an apache reverse proxy setup despite following this configuration: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy#apache

I did not get any helpful error other than "websocket failed" and I think there are likely some steps I am missing needed to get websocket traffic to get from the client (front-end) all the way past the apache reverse proxy and into the docker container 🤷🏽‍♂️

@CommanderStorm
Copy link
Collaborator

While cleaning up other issues, I came across louislam/uptime-kuma-wiki#73
Could you have a look if you have these paramerters enabled?

@CommanderStorm
Copy link
Collaborator

Closing in favour of #4210

@CommanderStorm CommanderStorm closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2023
@chakflying
Copy link
Collaborator

I don't think this is related to #4210, since 1.23.9 is not available when this issue was created.

@louislam louislam reopened this Dec 11, 2023
Copy link

We are clearing up our old help-issues and your issue has been open for 60 days with no activity.
If no comment is made and the stale label is not removed, this issue will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 14, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:deployment related to how uptime kuma can be deployed help question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

5 participants