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

Paths are broken when proxied through nginx #13

Open
john01dav opened this issue May 1, 2017 · 1 comment
Open

Paths are broken when proxied through nginx #13

john01dav opened this issue May 1, 2017 · 1 comment

Comments

@john01dav
Copy link

john01dav commented May 1, 2017

A server admin may want to proxy warmroast through nginx (or another web server) for several reasons such as authentication behind a username and password and TLS. When I attempted to do this via nginx, it worked correctly except that the paths given by warmroast are not relative. Specifically, the link to /stack and the styleheets do not take into account warmroast's new url. It should be noted that I am trying to run at a url like example.com/warmroast using the following nginx configuration:

        listen 80;
        listen [::]:80;
        listen 443 ssl http2;
        listen [::]:443 ssl http2;

        root /usr/share/nginx/html/admin;

        index index.html index.htm;

        server_name <redacted>;

        include /etc/nginx/snippets/ssl.conf;

        location / {
                try_files $uri $uri/ =404;
        }

        location /warmroast {
                proxy_pass http://127.0.0.1:23000/;
                proxy_set_header Host $host;
        }
}

Perhaps a command line flag such as --relative-paths or --warmroast-http-root would be the best solution?

@DosAmp
Copy link

DosAmp commented Sep 15, 2017

As a workaround, you can use the nginx sub module to replace absolute URLs in WarmRoast's HTML output with relative ones. As an example, we're not using custom CSS, so we only have to rewrite the /stack resources:

location /warmroast/ {
    proxy_pass http://localhost:8888/;
    proxy_http_version 1.1;
    proxy_set_header Accept-Encoding '';
    sub_filter '/stack' 'stack';
    error_page 502 /warmroast_offline.html;
}

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