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 File uploads (including images) not properly rendered/redirected when using custom subdirectory #1255

Open
Enotsoul opened this issue Feb 19, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Enotsoul
Copy link

Describe the bug

Hi

I've compiled apache manually to allow for the custom subdirectory

After struggling with the config I fiinally the custom subdirectory work properly (API+baseurl+reverse proxy)

However, there is an issue remaining with the fact that when I upload any file the URL is returned as ![freedom-jump-image.jpg](https://linsublim.com/community/uploads/post/5oL2sCfYUqy.jpg) but that won't work as it returns a 404 error.

What does work is /uploads/post/5oL2sCfYUqy.jpg but due to the fact that I'm using a subdirectory setup I need to fiddle with the reverse proxy and /uploads/ is farily common in many apps... so I'd rather keep things consistent:) Any chance this is a bug or another option exists to fix this?

Expected result

I'd expect for the app to correctly render the /community link in my config.

Config

Config file

debug: false
server:
  http:
    addr: 0.0.0.0:8100
data:
  database:
    driver: sqlite3
    connection: ./data/answer.db
  cache:
    file_path: cache/cache.db
i18n:
  bundle_dir: i18n
service_config:
  upload_path: uploads
swaggerui:
  show: true
  protocol: http
  host: 127.0.0.1
  address: :80
ui:
  public_url: '/community/'
  api_url: '/community/'
  base_url: "/community"

Thanks!

To Reproduce

Configure
Add a new question and try to upload an image or a file in the latest apache 1.4.2 self compiled version which has a subdirectory setting setup.

Screenshots

Self explainatory

Platform

Desktopand mobile
Linux Debian 12
Browser: ALL BROWSERS
Apache Answer version v.1.4.2

See meta answer
https://meta.answer.dev/questions/D1o13/bug-file-uploads-including-images-not-properly-rendered-redirected-when-using-custom-subdirectory

@Enotsoul Enotsoul added the bug Something isn't working label Feb 19, 2025
@LinkinStars
Copy link
Member

@Enotsoul Thanks for the feedback. You could change the code and quickly verify it.

static := r.Group("")

static := r.Group(uiConf.BaseURL)

Could you recompile after modifying the code and see if that fixes the issue?

@Enotsoul
Copy link
Author

Hi @LinkinStars

That does indeed seem to fix it. THanks :) 👍

@LinkinStars LinkinStars self-assigned this Feb 28, 2025
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

No branches or pull requests

2 participants