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

Exclude certain sub folder #300

Open
pixiemediaweb opened this issue Nov 29, 2023 · 1 comment
Open

Exclude certain sub folder #300

pixiemediaweb opened this issue Nov 29, 2023 · 1 comment
Assignees
Labels
discussion This topic needs some discussion.

Comments

@pixiemediaweb
Copy link

Is it possible to exclude certain folders?

My config has;

{
"HOST": "127.0.0.1",
"PORT": "3333",
"QUALITY": "80",
"IMG_PATH": "/var/www/live/pub",
"EXHAUST_PATH": "/var/www/webpcache",
"IMG_MAP": {},
"ALLOWED_TYPES": ["jpg","png","jpeg","bmp","svg","heic","nef"],
"ENABLE_AVIF": false,
"ENABLE_EXTRA_PARAMS": false
"READ_BUFFER_SIZE": 4096,
"CONCURRENCY": 262144,
"DISABLE_KEEPALIVE": false
}

But id like it to exclude images that live in /var/www/live/pub/some-folder

Is this possible?

@n0vad3v
Copy link
Member

n0vad3v commented Nov 29, 2023

Currently there is no way to do this on WebP Server Go, however there are some workarounds:

  • If you're using a reverse proxy like Nginx in front of it, you can add some path to make requests denied on Nginx, like:
server {
    listen 80;
    server_name your_domain.com;

    location / {
        proxy_pass http://localhost:3333;
        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 $scheme;
    }

    location ^~ /pub/some-folder {
        deny all;
        return 403;
    }
}

@BennyThink BennyThink added the discussion This topic needs some discussion. label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion This topic needs some discussion.
Projects
None yet
Development

No branches or pull requests

3 participants