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

Recursive reverse proxy calls #823

Closed
Pytonballoon810 opened this issue Jan 7, 2025 · 1 comment
Closed

Recursive reverse proxy calls #823

Pytonballoon810 opened this issue Jan 7, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Pytonballoon810
Copy link

Describe the bug
When using nginx (in the swag bundle) i get this error:
image

I do have these env variables:

      - DEFAULT_URI=https://parts.nobble.it/
      - TRUSTED_PROXIES=10.0.0.0/8

nginx config

server {
    listen 443 ssl;
    server_name parts.nobble.it;

    # Reverse proxy configuration
    location / {
        set $upstream_app partdb;  # Name of your Docker container or service in Docker Compose
        set $upstream_port 80;  # Port where PartDB is running inside the container (replace if different)
        set $upstream_proto http;  # Protocol to use (http or https)

        # Pass the request to the PartDB container
        proxy_set_header X-Forwarded-Prefix "/partdb";  # If you need to pass /partdb as a prefix to the container
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

        # Additional proxy headers to ensure correct routing and forwarding
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Dont mind the port numbers they are actually correct. I tried a few different server blocks but they all landed on the
/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/partdb/en/ Filename location in the end.

To Reproduce
Steps to reproduce the behavior:

  1. Have PartDB running in a docker container
  2. Also have nginx running in a docker container
  3. have both of them in a vlan such that you can address the containers internally
  4. have nginx rewrite everything to https:// and my server and location config for partdb

** container setup**

image
image

@Pytonballoon810 Pytonballoon810 added the bug Something isn't working label Jan 7, 2025
@Pytonballoon810
Copy link
Author

It works when using

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name parts.nobble.it;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth (requires ldap-location.conf in the location block)
    #include /config/nginx/ldap-server.conf;

    # enable for Authelia (requires authelia-location.conf in the location block)
    #include /config/nginx/authelia-server.conf;

    # enable for Authentik (requires authentik-location.conf in the location block)
    #include /config/nginx/authentik-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable for ldap auth (requires ldap-server.conf in the server block)
        #include /config/nginx/ldap-location.conf;

        # enable for Authelia (requires authelia-server.conf in the server block)
        #include /config/nginx/authelia-location.conf;

        # enable for Authentik (requires authentik-server.conf in the server block)
        #include /config/nginx/authentik-location.conf;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app partdb;
        set $upstream_port 80;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }

}

and

      - DEFAULT_URI=https://parts.nobble.it/
      - TRUSTED_PROXIES=10.0.0.0/8

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

1 participant