[GH-ISSUE #774] [BUG] images and videos broken #488

Closed
opened 2026-02-25 20:35:52 +03:00 by kerem · 22 comments
Owner

Originally created by @THENATHE on GitHub (Jun 3, 2022).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/774

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Install via docker
  2. Install apache on host os
  3. Set up a subdomain redirect (search.example.com) using a "proxy" to interact with the docker container
  4. Search images

Deployment Method

  • Heroku (one-click deploy)
  • Docker
  • run executable
  • pip/pipx
  • Other: [describe setup]

Version of Whoogle Search

  • Latest build from [source] (i.e. GitHub, Docker Hub, pip, etc)
  • Version [version number]
  • Not sure

Desktop (please complete the following information):

  • OS: Win11 and iOS
  • Browser Firefox and webkit
  • Version latest

Additional context
Images, when opening in new tab, redirect to localhost and not the image location

Originally created by @THENATHE on GitHub (Jun 3, 2022). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/774 **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Install via docker 2. Install apache on host os 3. Set up a subdomain redirect (search.example.com) using a "proxy" to interact with the docker container 4. Search images **Deployment Method** - [ ] Heroku (one-click deploy) - [x] Docker - [ ] `run` executable - [ ] pip/pipx - [ ] Other: [describe setup] **Version of Whoogle Search** - [ ] Latest build from [source] (i.e. GitHub, Docker Hub, pip, etc) - [ ] Version [version number] - [ ] Not sure **Desktop (please complete the following information):** - OS: Win11 and iOS - Browser Firefox and webkit - Version latest **Additional context** Images, when opening in new tab, redirect to localhost and not the image location
kerem 2026-02-25 20:35:52 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@DUOLabs333 commented on GitHub (Jun 4, 2022):

What version? Can we see the logs? What exactly happens?

<!-- gh-comment-id:1146677735 --> @DUOLabs333 commented on GitHub (Jun 4, 2022): What version? Can we see the logs? What exactly happens?
Author
Owner

@invis-z commented on GitHub (Jun 7, 2022):

@SangeloDev Maybe add your config here since it seems the same issue you are facing?

I suspect the key part is how the Apache/Nginx proxy is set up. However my setup doesn't involve such a proxy so it might need someone else to fix this.

<!-- gh-comment-id:1148153660 --> @invis-z commented on GitHub (Jun 7, 2022): @SangeloDev Maybe add your config here since it seems the same issue you are facing? I suspect the key part is how the Apache/Nginx proxy is set up. However my setup doesn't involve such a proxy so it might need someone else to fix this.
Author
Owner

@ratherDashing commented on GitHub (Jun 13, 2022):

if i search for "queen of england" the image points to: http://localhost:5000/element?url=gAAAAABip4XME_snEyJUMg10b_Ceo0Y9Wqy7Tyz0BySixtitgo_38wcUCHAbTimjL1pqowzuxnWsChkTPeao07IYST0UCqYT8diFRE0deK7P23UykHzxTolSB6OvioRVmwTuup-Jws5vm4nmS273TW9-YWGWWcqXkQAoBrvNTOS3cfFvwhRljzNnHui8MezG40z1dtyxUDs9WWzOU1hHIh7tfh2--QfO54tzlFtty0QTH3rin0iADL0=&type=image/png

even though i have my root url setup. so all images are broken since i host this on a different computer than my own.

i am using docker and have nginx hosting my ssl cert and redirecting to whoogle

0.7.1 is the last version that works for me so i am reverting. i've tried 0.7.2 and 0.7.4

<!-- gh-comment-id:1154261093 --> @ratherDashing commented on GitHub (Jun 13, 2022): if i search for "queen of england" the image points to: http://localhost:5000/element?url=gAAAAABip4XME_snEyJUMg10b_Ceo0Y9Wqy7Tyz0BySixtitgo_38wcUCHAbTimjL1pqowzuxnWsChkTPeao07IYST0UCqYT8diFRE0deK7P23UykHzxTolSB6OvioRVmwTuup-Jws5vm4nmS273TW9-YWGWWcqXkQAoBrvNTOS3cfFvwhRljzNnHui8MezG40z1dtyxUDs9WWzOU1hHIh7tfh2--QfO54tzlFtty0QTH3rin0iADL0=&type=image/png even though i have my root url setup. so all images are broken since i host this on a different computer than my own. i am using docker and have nginx hosting my ssl cert and redirecting to whoogle 0.7.1 is the last version that works for me so i am reverting. i've tried 0.7.2 and 0.7.4
Author
Owner

@printfuck commented on GitHub (Jun 13, 2022):

I am just now trying to setup my instance and came across the following problem:

It seems, that the root url is being applied improperly:

with whoogle_config_url set to https://my.do.main I get the following image links:

https://my.do.main/127.0.0.1://my.do.main,%20my.do.main/element?url=gAAAAABip47Wtf4UnXgwwOICSUyxUaHyh0_qobXc76Q1wslTQNmBT8vpcU8vgBKJl4pJHeUTqZWO8P3RE_SQWYmTseBW4mfVg01qi5G4P6KH5CNz9YCkTUQaXQFKkysj4xd1TKiCj9dK96WhDF5pumU1E0D8JjfSNcJO3ZAmhk_xG6fwADE4Gt18bWRa70sieaWgMZdRbo8eBi7j_FKfYhBg-qveDYRiUzpbwBfmMbAlYxmQcMnFG7o=&type=image/png

with whoogle_config_url set to my.do.main I get redirection storms until firefox gives up:

https://my.do.main%2C%20my.do.main/element?url=gAAAAABip5Lvu4LwuLALvpwngIzEFfW6_hZ1JNv_3iFbYUKQy0smEnz91KAt1RdfI2K7Wju05yfiGY-dwazrXCvtmOFf0Y5TgCyTqa5CbJN5-h8y4JGerBbMmPredkXpuYH2EJUrWCuqLcMbiwIp8M16d2BwEYDy3Z4jX4V_nKCZad9fCFbU7pcOI8Usq18tHh8SoYXqVBVuUinpQYRtfAhCkUTlcJ5XGKYF9MTAuP0jBRW3UFYg-fA=&type=image/png

Without setting it at all, I got this:

https://my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/

My nginx config:

        location / {
                proxy_pass http://127.0.0.1:8009;
                proxy_redirect off;
                proxy_buffering off;
                proxy_set_header Host $host;
                proxy_http_version 1.1;
                #proxy_set_header Upgrade $http_upgrade;
                #proxy_set_header Connection "upgrade";
                #proxy_read_timeout 86400;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $remote_addr;
        }

Domain name replaced with my.do.main.

<!-- gh-comment-id:1154359325 --> @printfuck commented on GitHub (Jun 13, 2022): I am just now trying to setup my instance and came across the following problem: It seems, that the `root url` is being applied improperly: with `whoogle_config_url` set to `https://my.do.main` I get the following image links: ``` https://my.do.main/127.0.0.1://my.do.main,%20my.do.main/element?url=gAAAAABip47Wtf4UnXgwwOICSUyxUaHyh0_qobXc76Q1wslTQNmBT8vpcU8vgBKJl4pJHeUTqZWO8P3RE_SQWYmTseBW4mfVg01qi5G4P6KH5CNz9YCkTUQaXQFKkysj4xd1TKiCj9dK96WhDF5pumU1E0D8JjfSNcJO3ZAmhk_xG6fwADE4Gt18bWRa70sieaWgMZdRbo8eBi7j_FKfYhBg-qveDYRiUzpbwBfmMbAlYxmQcMnFG7o=&type=image/png ``` with `whoogle_config_url` set to `my.do.main` I get redirection storms until firefox gives up: ``` https://my.do.main%2C%20my.do.main/element?url=gAAAAABip5Lvu4LwuLALvpwngIzEFfW6_hZ1JNv_3iFbYUKQy0smEnz91KAt1RdfI2K7Wju05yfiGY-dwazrXCvtmOFf0Y5TgCyTqa5CbJN5-h8y4JGerBbMmPredkXpuYH2EJUrWCuqLcMbiwIp8M16d2BwEYDy3Z4jX4V_nKCZad9fCFbU7pcOI8Usq18tHh8SoYXqVBVuUinpQYRtfAhCkUTlcJ5XGKYF9MTAuP0jBRW3UFYg-fA=&type=image/png ``` Without setting it at all, I got this: ``` https://my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/127.0.0.1://my.do.main,%20my.do.main/ ``` My nginx config: ``` location / { proxy_pass http://127.0.0.1:8009; proxy_redirect off; proxy_buffering off; proxy_set_header Host $host; proxy_http_version 1.1; #proxy_set_header Upgrade $http_upgrade; #proxy_set_header Connection "upgrade"; #proxy_read_timeout 86400; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $remote_addr; } ``` Domain name replaced with my.do.main.
Author
Owner

@DUOLabs333 commented on GitHub (Jun 13, 2022):

@printfuck Can you try accessing it by IP? If it works, then it's a nginx issue.

<!-- gh-comment-id:1154363467 --> @DUOLabs333 commented on GitHub (Jun 13, 2022): @printfuck Can you try accessing it by IP? If it works, then it's a nginx issue.
Author
Owner

@printfuck commented on GitHub (Jun 13, 2022):

@DUOLabs333 When trying to access it by ip:port, I get an empty response.

version: "2.4"

services:
  whoogle-search:
    image: benbusby/whoogle-search
    container_name: whoogle-search
    restart: unless-stopped
    pids_limit: 50
    mem_limit: 256mb
    memswap_limit: 256mb
    # user debian-tor from tor package
    user: whoogle
    security_opt:
      - no-new-privileges
    cap_drop:
      - ALL
    tmpfs:
      - /config/:size=10M,uid=927,gid=927,mode=1700
      - /var/lib/tor/:size=15M,uid=927,gid=927,mode=1700
      - /run/tor/:size=1M,uid=927,gid=927,mode=1700
    volumes:
      - ./start-tor.sh:/whoogle/misc/tor/start-tor.sh:ro
    environment: # Uncomment to configure environment variables
      # Basic auth configuration, uncomment to enable
      - WHOOGLE_USER=nya
      - WHOOGLE_PASS=nya
      - WHOOGLE_CONFIG_URL=my.do.main
      # Proxy configuration, uncomment to enable
      #- WHOOGLE_PROXY_USER=<proxy username>
      #- WHOOGLE_PROXY_PASS=<proxy password>
      #- WHOOGLE_PROXY_TYPE=<proxy type (http|https|socks4|socks5)
      #- WHOOGLE_PROXY_LOC=<proxy host/ip>
      # Site alternative configurations, uncomment to enable
      # Note: If not set, the feature will still be available
      # with default values.
      #- WHOOGLE_ALT_TW=farside.link/nitter
      #- WHOOGLE_ALT_YT=farside.link/invidious
      #- WHOOGLE_ALT_IG=farside.link/bibliogram/u
      #- WHOOGLE_ALT_RD=farside.link/libreddit
      #- WHOOGLE_ALT_MD=farside.link/scribe
      #- WHOOGLE_ALT_TL=farside.link/lingva
      #- WHOOGLE_ALT_IMG=farside.link/rimgo
      #- WHOOGLE_ALT_WIKI=farside.link/wikiless
    #env_file: # Alternatively, load variables from whoogle.env
      #- whoogle.env
    ports:
      - 127.0.0.1:8009:5000

docker-compose.yml for reference

<!-- gh-comment-id:1154369049 --> @printfuck commented on GitHub (Jun 13, 2022): @DUOLabs333 When trying to access it by ip:port, I get an empty response. ``` version: "2.4" services: whoogle-search: image: benbusby/whoogle-search container_name: whoogle-search restart: unless-stopped pids_limit: 50 mem_limit: 256mb memswap_limit: 256mb # user debian-tor from tor package user: whoogle security_opt: - no-new-privileges cap_drop: - ALL tmpfs: - /config/:size=10M,uid=927,gid=927,mode=1700 - /var/lib/tor/:size=15M,uid=927,gid=927,mode=1700 - /run/tor/:size=1M,uid=927,gid=927,mode=1700 volumes: - ./start-tor.sh:/whoogle/misc/tor/start-tor.sh:ro environment: # Uncomment to configure environment variables # Basic auth configuration, uncomment to enable - WHOOGLE_USER=nya - WHOOGLE_PASS=nya - WHOOGLE_CONFIG_URL=my.do.main # Proxy configuration, uncomment to enable #- WHOOGLE_PROXY_USER=<proxy username> #- WHOOGLE_PROXY_PASS=<proxy password> #- WHOOGLE_PROXY_TYPE=<proxy type (http|https|socks4|socks5) #- WHOOGLE_PROXY_LOC=<proxy host/ip> # Site alternative configurations, uncomment to enable # Note: If not set, the feature will still be available # with default values. #- WHOOGLE_ALT_TW=farside.link/nitter #- WHOOGLE_ALT_YT=farside.link/invidious #- WHOOGLE_ALT_IG=farside.link/bibliogram/u #- WHOOGLE_ALT_RD=farside.link/libreddit #- WHOOGLE_ALT_MD=farside.link/scribe #- WHOOGLE_ALT_TL=farside.link/lingva #- WHOOGLE_ALT_IMG=farside.link/rimgo #- WHOOGLE_ALT_WIKI=farside.link/wikiless #env_file: # Alternatively, load variables from whoogle.env #- whoogle.env ports: - 127.0.0.1:8009:5000 ``` docker-compose.yml for reference
Author
Owner

@DUOLabs333 commented on GitHub (Jun 13, 2022):

So the service is not even up?

<!-- gh-comment-id:1154369767 --> @DUOLabs333 commented on GitHub (Jun 13, 2022): So the service is not even up?
Author
Owner

@printfuck commented on GitHub (Jun 13, 2022):

The service is up. I can reach it via domain through nginx.

<!-- gh-comment-id:1154371259 --> @printfuck commented on GitHub (Jun 13, 2022): The service is up. I can reach it via domain through nginx.
Author
Owner

@DUOLabs333 commented on GitHub (Jun 13, 2022):

But you can't access it with ip:port?

<!-- gh-comment-id:1154371967 --> @DUOLabs333 commented on GitHub (Jun 13, 2022): But you can't access it with ip:port?
Author
Owner

@printfuck commented on GitHub (Jun 13, 2022):

Ok, I'm an idiot. Accessing it locally with ip:port totally works with images loading all right. I messed up my ssh forward.

<!-- gh-comment-id:1154374256 --> @printfuck commented on GitHub (Jun 13, 2022): Ok, I'm an idiot. Accessing it locally with ip:port totally works with images loading all right. I messed up my ssh forward.
Author
Owner

@DUOLabs333 commented on GitHub (Jun 13, 2022):

So, does everything works?

<!-- gh-comment-id:1154374887 --> @DUOLabs333 commented on GitHub (Jun 13, 2022): So, does everything works?
Author
Owner

@printfuck commented on GitHub (Jun 13, 2022):

I still get image links like this:

https://my.do.main%2C%20my.do.main/element?url=gAAAAABip5gwkih2a-LRIgBJh6lJqduzsQdJsARshjwo_byZ96z6nogg4Aax3uJIeugeLtz7YqQZcIgucF5hr7SyTPuQmY7G_CJi_Qfp3kLfm46D4P_hFBn1MMBk313GZT3kK3K2bdFBnJWswloSkb0-HkML35q3oNXanE4DLPkvQG6PmxVhsG2aq_CD37-DMkVLKfOH-eP0ArHh7__zljJo4oiURS1A3Mk3H1xdFDd56RoXuMsw80I=&type=image/png

with my posted config. With https://my.do.main%2C%20my.do.main/ still not being a valid domain.

<!-- gh-comment-id:1154378865 --> @printfuck commented on GitHub (Jun 13, 2022): I still get image links like this: ``` https://my.do.main%2C%20my.do.main/element?url=gAAAAABip5gwkih2a-LRIgBJh6lJqduzsQdJsARshjwo_byZ96z6nogg4Aax3uJIeugeLtz7YqQZcIgucF5hr7SyTPuQmY7G_CJi_Qfp3kLfm46D4P_hFBn1MMBk313GZT3kK3K2bdFBnJWswloSkb0-HkML35q3oNXanE4DLPkvQG6PmxVhsG2aq_CD37-DMkVLKfOH-eP0ArHh7__zljJo4oiURS1A3Mk3H1xdFDd56RoXuMsw80I=&type=image/png ``` with my posted config. With `https://my.do.main%2C%20my.do.main/` still not being a valid domain.
Author
Owner

@DUOLabs333 commented on GitHub (Jun 13, 2022):

But with ip:port, does it work as expected?

<!-- gh-comment-id:1154379515 --> @DUOLabs333 commented on GitHub (Jun 13, 2022): But with ip:port, does it work as expected?
Author
Owner

@DUOLabs333 commented on GitHub (Jun 13, 2022):

Then it's probably something with your nginx config: try only

 proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                proxy_set_header X-NginX-Proxy true;
<!-- gh-comment-id:1154386887 --> @DUOLabs333 commented on GitHub (Jun 13, 2022): Then it's probably something with your nginx config: try only ``` proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-NginX-Proxy true; ```
Author
Owner

@printfuck commented on GitHub (Jun 13, 2022):

You're right and thanks for your help so far.

I fixed my problem: my nginx config added the Host Header 2 times. Resulting in a variable that looks like "my.do.main, my.do.main".

It's a weird error, but something you might want to catch in your backend?

<!-- gh-comment-id:1154388796 --> @printfuck commented on GitHub (Jun 13, 2022): You're right and thanks for your help so far. I fixed my problem: my nginx config added the `Host` Header 2 times. Resulting in a variable that looks like "my.do.main, my.do.main". It's a weird error, but something you might want to catch in your backend?
Author
Owner

@DUOLabs333 commented on GitHub (Jun 13, 2022):

Oh, I didn't even notice that. I'm not sure whether whoogle should be responsible for checking the correctness of headers.

<!-- gh-comment-id:1154389772 --> @DUOLabs333 commented on GitHub (Jun 13, 2022): Oh, I didn't even notice that. I'm not sure whether whoogle should be responsible for checking the correctness of headers.
Author
Owner

@printfuck commented on GitHub (Jun 13, 2022):

I also don't think it should. I think you could probably mess up a lot of other web-apps by doing this :D

<!-- gh-comment-id:1154391556 --> @printfuck commented on GitHub (Jun 13, 2022): I also don't think it should. I think you could probably mess up a lot of other web-apps by doing this :D
Author
Owner

@DUOLabs333 commented on GitHub (Jun 13, 2022):

Awesome. @ratherDashing Can you send your config (be warned: I don't know much about apache).

<!-- gh-comment-id:1154394008 --> @DUOLabs333 commented on GitHub (Jun 13, 2022): Awesome. @ratherDashing Can you send your config (be warned: I don't know much about apache).
Author
Owner

@ratherDashing commented on GitHub (Jun 14, 2022):

@DUOLabs333
Thank you!
location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-NginX-Proxy true; proxy_pass http://localhost:5000; }
worked for me

<!-- gh-comment-id:1155160737 --> @ratherDashing commented on GitHub (Jun 14, 2022): @DUOLabs333 Thank you! `location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-NginX-Proxy true; proxy_pass http://localhost:5000; }` worked for me
Author
Owner

@DUOLabs333 commented on GitHub (Jun 14, 2022):

Oh nice! @THENATHE Do you still have this issue?

<!-- gh-comment-id:1155162359 --> @DUOLabs333 commented on GitHub (Jun 14, 2022): Oh nice! @THENATHE Do you still have this issue?
Author
Owner

@nocturn9x commented on GitHub (Jun 21, 2022):

Can confirm adding the headers fixes the problem! Thanks, it was driving me crazy. Whoogle is such a great tool!

<!-- gh-comment-id:1161974494 --> @nocturn9x commented on GitHub (Jun 21, 2022): Can confirm adding the headers fixes the problem! Thanks, it was driving me crazy. Whoogle is such a great tool!
Author
Owner

@DUOLabs333 commented on GitHub (Jun 21, 2022):

Wonder if this should be posted in the README.

<!-- gh-comment-id:1161975491 --> @DUOLabs333 commented on GitHub (Jun 21, 2022): Wonder if this should be posted in the README.
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/whoogle-search#488
No description provided.