Skip to content

Configuring base_url for sregistry when deployed behind an Apache reverse proxy on port 80 #441

@imerelli

Description

@imerelli

Hello,

I'm trying to deploy sregistry behind an Apache reverse proxy on port 80 and have run into some issues with the application's URLs. I've set up Apache to route requests from /sregistry to the sregistry application running on port 81, as I have other sites and configurations on my server.

Here's my current Apache configuration:

<VirtualHost *:80>

    # Enable rewrite module
    RewriteEngine On

    # Redirect /sregistry to /sregistry/
    RewriteRule ^/sregistry$ /sregistry/ [R=301,L]

    # Proxy requests to sregistry
    RewriteRule ^/sregistry/(.*)$ http://localhost:81/$1 [P,L]

    ProxyPreserveHost On
    ProxyRequests Off

    # Handle reverse proxying
    ProxyPassReverse /sregistry/ http://localhost:81/

    # Specific rules for static resources
    ProxyPass /static/ http://localhost:81/static/
    ProxyPassReverse /static/ http://localhost:81/static/
</VirtualHost>

With this configuration, I'm able to access the sregistry homepage fine. However, some internal application links, like /collections and /login, are broken because they don't seem to be aware of the /sregistry prefix.

I assume there's a need to adjust a base_url or similar setting in the sregistry configuration to inform it of the /sregistry prefix. Could you provide guidance on how to properly configure this or point out if there's any step I might be overlooking?

Thank you for your assistance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions