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

[BUG] Docker container returns 404 when visiting relative URLs #619

Open
sibbl opened this issue Feb 12, 2023 · 3 comments · May be fixed by #751
Open

[BUG] Docker container returns 404 when visiting relative URLs #619

sibbl opened this issue Feb 12, 2023 · 3 comments · May be fixed by #751
Labels
bug Something isn't working

Comments

@sibbl
Copy link
Contributor

sibbl commented Feb 12, 2023

Describe the bug
When visiting /room/test in the Docker container, the nginx does return a 404.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy the Docker container e.g. using the docker-compose.yaml and the image of this repository
  2. Create a new room called "test"
  3. Open the URL shown in the dialog, e.g. http://localhost:3000/room/test
  4. A 404 is returned

Expected behavior
The index.html is returned, so that Vue router can show the correct view.

@sibbl sibbl added the bug Something isn't working label Feb 12, 2023
@tigattack
Copy link
Contributor

I was able to fix this like so:

# /etc/nginx/conf.d/default.conf
server {
    listen       80;
    server_name  localhost;

    #access_log  /var/log/nginx/host.access.log  main;

+    root   /usr/share/nginx/html;
+    index  index.html index.htm;

    location / {
-        root   /usr/share/nginx/html;
-        index  index.html index.htm;
+        try_files $uri $uri/ /index.html;
    }

@aadityadhruv
Copy link

Did you make this a permanent change by mounting the file to the path? I'm facing the same issue.

@aadityadhruv
Copy link

I did precisely that, and it worked. Thanks!

@HelloJowet HelloJowet linked a pull request May 14, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants