[GH-ISSUE #95] Pictshare doesn't work with docker and nginx proxy_pass #70

Closed
opened 2026-02-25 23:40:35 +03:00 by kerem · 3 comments
Owner

Originally created by @dessalines on GitHub (Sep 7, 2019).
Original GitHub issue: https://github.com/HaschekSolutions/pictshare/issues/95

Use case: I want both pictshare, and other services running on the same box, at the same domain, so use nginx proxy_pass.

I'm running the pictshare docker (at a specific port) which works well, but for some reason, if the nginx location that isn't at the top domain, it doesn't work.

Doesn't work:

    location /pictshare/ {
      proxy_pass http://0.0.0.0:8537;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

Works:

    location / {
      proxy_pass http://0.0.0.0:8537;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
Originally created by @dessalines on GitHub (Sep 7, 2019). Original GitHub issue: https://github.com/HaschekSolutions/pictshare/issues/95 Use case: I want both pictshare, and other services running on the same box, at the same domain, so use nginx proxy_pass. I'm running the pictshare docker (at a specific port) which works well, but for some reason, if the nginx location that isn't at the top domain, it doesn't work. Doesn't work: ``` location /pictshare/ { proxy_pass http://0.0.0.0:8537; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } ``` Works: ``` location / { proxy_pass http://0.0.0.0:8537; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } ```
kerem closed this issue 2026-02-25 23:40:35 +03:00
Author
Owner

@dessalines commented on GitHub (Sep 7, 2019):

Okay I half figured this out, but the css and such are still all served at the top level, and wrong, but at least upload.php, and the share urls are correctly routed.

proxy_pass needs a slash after it:

proxy_pass http://0.0.0.0:8537/;

<!-- gh-comment-id:529154065 --> @dessalines commented on GitHub (Sep 7, 2019): Okay I half figured this out, but the css and such are still all served at the top level, and wrong, but at least upload.php, and the share urls are correctly routed. proxy_pass needs a slash after it: `proxy_pass http://0.0.0.0:8537/;`
Author
Owner

@dessalines commented on GitHub (Sep 8, 2019):

Another really bad issue: when using proxy_pass, it can't serve mp4s correctly. I played with it for 3+ hours and couldn't get it working.

error in web console: HTTP “Content-Type” of “text/html” is not supported. Load of media resource http://test.lemmy.com/pictshare/hovz5z.mp4 failed.

I tried overwriting the content-type of all mp4s served, but unfortunately it still had errors.

<!-- gh-comment-id:529162297 --> @dessalines commented on GitHub (Sep 8, 2019): Another **really bad** issue: when using proxy_pass, it can't serve mp4s correctly. I played with it for 3+ hours and couldn't get it working. error in web console: `HTTP “Content-Type” of “text/html” is not supported. Load of media resource http://test.lemmy.com/pictshare/hovz5z.mp4 failed.` I tried overwriting the content-type of all mp4s served, but unfortunately it still had errors.
Author
Owner

@dessalines commented on GitHub (Sep 8, 2019):

Wait nevermind, I figured out that one. The videos are actually at url/raw, unlike the images.

<!-- gh-comment-id:529163265 --> @dessalines commented on GitHub (Sep 8, 2019): Wait nevermind, I figured out that one. The videos are actually at `url/raw`, unlike the images.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pictshare#70
No description provided.