Code Monkey home page Code Monkey logo

Comments (6)

darkweak avatar darkweak commented on June 3, 2024

I do not actively maintain the standalone server because of the multiple constraints to built a reverse proxy. I recommend to use Souin as middleware in caddy or traefik reverse proxy. However I will investigate on that panic but in my first opinion, the Souin standalone server is designed to run in front of another reverse proxy (Apache, nginx, caddy, Træfik, ...). You cannot proxy directly to google but you should have something like
Incoming traffic -> Souin -> traefik -> service and your Souin configuration should be

default_cache:
    ttl: 30s
reverse_proxy: http://traefik

from souin.

marcoreni avatar marcoreni commented on June 3, 2024

What's the difference in terms of having a "local (maybe virtual) network" upstream (traefik) vs. a remote upstream (google)?

Anyhow, if the standalone server is not maintained maybe it should be made more clear in the readme? By reading here: https://github.com/darkweak/souin#souin-out-of-the-box and seeing otherwise just use https://yourdomain.com I assume differently.

from souin.

darkweak avatar darkweak commented on June 3, 2024

Træfik is a reverse proxy, Souin is not. yourdomain.com is the domain to use to contact the reverse proxy and transfer the request to it.

from souin.

marcoreni avatar marcoreni commented on June 3, 2024

I've added traefik as you suggested. I'm no expert in the service so I followed and adapted the basic example found on the traefik docs.

Panic is still there.

version: "3.7"

services:
  proxy:
    image: darkweak/souin:v1.6.28
    ports: 
      - 80:80
      - 443:443
    volumes:
      - ./configuration/configuration.yml:/configuration/configuration.yml
  traefik:
    image: "traefik:v2.9"
    container_name: "traefik"
    command:
      #- "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

  whoami:
    image: "traefik/whoami"
    container_name: "simple-service"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoami.rule=Host(`localhost`)"
      - "traefik.http.routers.whoami.entrypoints=web"
log_level: DEBUG

default_cache: # Required part
  port: # Ports to expose Souin
    web: 80
    tls: 443
  ttl: 10s # Default TTL
reverse_proxy_url: 'http://traefik'

(EDIT: I've also tried downgrading Souin, that's why I'm using 1.6.28 here)

I'll explore using souin as a middleware.

from souin.

darkweak avatar darkweak commented on June 3, 2024

That's a bug then 😅

from souin.

darkweak avatar darkweak commented on June 3, 2024

Well I opened a PR that handle HTTP proxy errors. In your case, you have to put a real proxy between your souin instance and the service you want to proxy the request (caddy is easier to configure for that). If you target http://google.com or http://www.google.com it will work because there are no TLS verifications and it's not on the roadmap to support that.

I can come back later with an example using caddy if you need it.

from souin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.