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 forward all requests to the new URL #738

Open
Tsunani opened this issue Jun 29, 2022 · 2 comments
Open

Nginx forward all requests to the new URL #738

Tsunani opened this issue Jun 29, 2022 · 2 comments

Comments

@Tsunani
Copy link

Tsunani commented Jun 29, 2022

Hello all. How can i change url for baget in Docker?
With location / { all work fine
But with this not work

location /newurl/ {
                 proxy_pass              http://127.0.0.1:4444;
                 proxy_http_version      1.1;
                 proxy_set_header        Upgrade $http_upgrade;
                 proxy_set_header        Connection keep-alive;
                 proxy_set_header        Host $host;
                 proxy_cache_bypass      $http_upgrade;
                 proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                 proxy_set_header        X-Forwarded-Proto $scheme;
                 }

Can anybody tell me about configuration nginx, please?
Thanks

@ThePsycho21
Copy link

Add a trailing slash for your proxy_pass url, like so:

proxy_pass http://127.0.0.1:4444/;

This way nginx will be able to properly replace /newurl/ in your URI subpath with the desired proxy uri, so requests to http://my-baget-server.com/newurl/packages will be properly proxied to http://127.0.0.1:4444/packages for example, while your current configuration will lead to URI like http://127.0.0.1:4444/newurl/packages

@Tsunani
Copy link
Author

Tsunani commented Aug 8, 2022

Thanks for answer, but at nginx i have like proxy_pass http://127.0.0.1:4444/;
And at URL http://my.url/baget/ have a clear page with top menu.
When click in the menu on "Packages" or "Upload" i get normal page, but in URL http://my.url not http://my-url/baget/

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