lukevella / rallly

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
https://rallly.co
GNU Affero General Public License v3.0
3.55k stars 338 forks source link

Polls and magic link creation bot working behind nginx reverse proxy #310

Closed BackedUpBooty closed 2 years ago

BackedUpBooty commented 2 years ago

Describe the bug When accessing the service behind a reverse proxy, trying to log in with magic link or creating a new poll comes up with an error. This doesn't happen when accessing it locally via http://ip:port. No errors or warnings are shown in logs, however the console is showing that the service is trying to access the api via the local http://ip:port address rather than the reverse proxy https URL (see screenshot below). The repo was cloned today, this is a fresh install.

The .env has the 32 character SECRET_PASSWORD, and the NEXT_PUBLIC_BASE_URL is set to the https subdomain I use.

To Reproduce Steps to reproduce the behavior:

  1. Clone the repo
  2. Modify the docker-compose.yml and .env with own unique variables as required
  3. docker-compose up
  4. Do required things to have the service available at https://rallly.pointtosource.com (geolocked to Japan in case you want to try it)
  5. Access service at https://rallly.pointtosource.com
  6. Try and create magic link, or try and create poll
  7. Fail
  8. Access service locally on http://192.168.1.2:3303
  9. Try and create magic link or poll
  10. Success, email is received with link back to http://192.168.1.2:3303

Expected behavior Accessing the service via reverse proxy URL should attempt access to API via the reverse proxy, not local IP.

Screenshots image image

Docker Compose

version: "3.3"
services:
  rallly_db:
    image: postgres:14.2
    restart: unless-stopped
    container_name: rallly-db
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=postgres

  rallly:
    build:
      context: .
      args:
        - DATABASE_URL=postgres://postgres:postgres@rallly_db:5432/db?pgbouncer=true
    restart: unless-stopped
    container_name: rallly
    depends_on:
      - rallly_db
    ports:
      - 3303:3000
    environment:
      - DATABASE_URL=postgres://postgres:postgres@rallly_db:5432/db
    env_file:
      - .env

volumes:
  db-data:
    driver: local

Desktop (please complete the following information):

lukevella commented 2 years ago

The behaviour you're describing isn't consistent with recent versions of the app. Can you please update to the latest version by fetching and pulling from the main branch and let me know if you're still having the same issue?

BackedUpBooty commented 2 years ago

Not sure how I was still on an older version but I guess I must have been. Did a --force-recreate --build and it fixed it. Thanks for that.