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

nginx subpath support #1176

Open
phuslu opened this issue May 6, 2024 · 0 comments
Open

nginx subpath support #1176

phuslu opened this issue May 6, 2024 · 0 comments

Comments

@phuslu
Copy link

phuslu commented May 6, 2024

Hi there,

Currently I have a workaround/hacked nginx.conf could proxy spdf in subpath

    location ~ /spdf/ {
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;
        rewrite /spdf/(.*) /$1  break;
        sub_filter 'href="/apple-touch-icon.png' 'href="/spdf/apple-touch-icon.png';
        sub_filter 'href="/favicon-32x32.png' 'href="/spdf/favicon-32x32.png';
        sub_filter 'href="/favicon-16x16.png' 'href="/spdf/favicon-16x16.png';
        sub_filter 'href="/site.webmanifest' 'href="/spdf/site.webmanifest';
        sub_filter 'href="/safari-pinned-tab.svg' 'href="/spdf/safari-pinned-tab.svg';
        sub_filter 'href="/favicon.ico' 'href="/spdf/favicon.ico';
        sub_filter 'href="/pdfjs/css/' 'href="pdfjs/css/';
        sub_filter 'action="/' 'action="/spdf/';
        sub_filter_once off;
        proxy_redirect https://phus.lu/ https://phus.lu/spdf/;
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection Upgrade;
    }

As we seen, it's a bit hacky and risky -- although it's the only workable way -- I write it down here for guys who need it.

Could spdf consider add official subpath proxy support?

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

1 participant