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

Issue with 307 Temporary Redirect on Nginx Server when accessing /path #4225

Open
RelievedCy opened this issue Jan 15, 2025 · 1 comment
Open
Labels
question Further information is requested

Comments

@RelievedCy
Copy link

RelievedCy commented Jan 15, 2025

Description

Description:
When running the website locally, using ui.navigate.to('/path') works without any issues. However, when the website is deployed on a server using Nginx, accessing /path results in a 307 Temporary Redirect. The following request is observed in the server logs:
GET /_nicegui_ws/socket.io/?client_id=11319444-9edd-46d6-bda5-f9ec84136760&next_message_id=0&EIO=4&transport=websocket HTTP/1.1

This request returns a status code of 101 and a response size of 224 bytes.

Steps to Reproduce:

  • Deploy the website on a server using Nginx.
  • Use ui.navigate.to('/path') in the application.
  • Access the /path endpoint.

Expected Behavior:
The application should navigate to /path without any redirects or errors.

Actual Behavior:
The application redirects to 127.0.0.1:443/path with a 307 Temporary Redirect status code.

Temporary Workaround:
Changing the parameter in ui.navigate.to('/path') to ui.navigate.to('/path/') resolves the issue and allows the application to run normally.

Environment:
Server: Nginx
Application Framework: [NiceGUI 2.9.1]
Operating System: [Centos 8,]
Browser: [Edge]

Additional Information:
The issue does not occur when running the application locally.
The server logs indicate a WebSocket connection attempt with a 101 status code, which suggests a successful upgrade to WebSocket but is followed by the 307 redirect.

@rodja
Copy link
Member

rodja commented Jan 21, 2025

Can you, please, try to create a minimum reproducible code example including the NiceGUI app, Nginx config and so forth? This would allow us and the community to help more efficiently. Thanks!
Why is it important to provide a minimal reproducible example?

@falkoschindler falkoschindler added the question Further information is requested label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants