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

Log in page is blank #482

Open
Ranger-4297 opened this issue Jan 20, 2025 · 1 comment
Open

Log in page is blank #482

Ranger-4297 opened this issue Jan 20, 2025 · 1 comment

Comments

@Ranger-4297
Copy link

Ranger-4297 commented Jan 20, 2025

Describe the bug

Attempting to move the api backend to a path of the main url for convienience, after getting my reverse proxy to work, the login button redirects to /api/oauth/spotify. Not /api/oauth/spotify/callback and the page is completely blank/black. Manually setting my URL to include /callback doesn't affect this whatsoever.

Current docker compose

services:
  server:
    image: yooooomi/your_spotify_server
    restart: always
    ports:
      - "8086:8080"
    links:
      - mongo
    depends_on:
      - mongo
    environment:
      API_ENDPOINT: https://spotify.rhykerw.com/api # This MUST be included as a valid URL in the spotify dashboard (see below)
      CLIENT_ENDPOINT: https://spotify.rhykerw.com
      SPOTIFY_PUBLIC: XXX1
      SPOTIFY_SECRET: XXX2
  mongo:
    container_name: mongo
    image: mongo:4.4.18
    volumes:
      - /home/rhyker/docker/spotify:/data/db

  web:
    image: yooooomi/your_spotify_client
    restart: always
    ports:
      - "8087:3000"
    environment:
      API_ENDPOINT: https://spotify.rhykerw.com/api

Reverse proxy config (NGINX Proxy Manager. Manually edited file)

# ------------------------------------------------------------
# spotify.rhykerw.com
# ------------------------------------------------------------


map $scheme $hsts_header {
    https   "max-age=63072000; preload";
}

server {
  set $forward_scheme http;
  set $server         "rhykerw";
  set $port           8087;

  listen 80;
listen [::]:80;

  server_name spotify.rhykerw.com;
http2 off;

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;

  access_log /data/logs/proxy-host-9_access.log proxy;
  error_log /data/logs/proxy-host-9_error.log warn;

  location / {

    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
    proxy_http_version 1.1;


    # Proxy!
    include conf.d/include/proxy.conf;
  }


  # Custom
  include /data/nginx/custom/server_proxy[.]conf;


  location /api {
    set $upstream_port 8086;
    proxy_pass $forward_scheme://$server:$upstream_port;
  }
}

Spotify developer dashboard
Image

It's worth noting that up until I attempted to move to the /api path of spotify.rhykerw.com for the back-end, everything worked smoothly

@Vahelnir
Copy link

Vahelnir commented Feb 1, 2025

Hey, not sure if you already fixed your issue yet, but you should try changing your api proxy to be something along the line of

location /api/ {
    set $upstream_port 8086;
    proxy_pass $forward_scheme://$server:$upstream_port/;
 }

(note the trailing slashes in the location /api/ and $forward_scheme://$server:$upstream_port/)

see https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants