mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-30 00:01:25 +00:00
Merge pull request 'Disable rate limiting for pictrs' (#79) from pictrs-disable-rate-limiting into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/79
This commit is contained in:
commit
780e7f9497
1 changed files with 11 additions and 3 deletions
14
ansible/templates/nginx.conf
vendored
14
ansible/templates/nginx.conf
vendored
|
@ -51,9 +51,6 @@ server {
|
||||||
# Upload limit for pictrs
|
# Upload limit for pictrs
|
||||||
client_max_body_size 20M;
|
client_max_body_size 20M;
|
||||||
|
|
||||||
# Rate limit
|
|
||||||
limit_req zone=lemmy_ratelimit burst=30 nodelay;
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://0.0.0.0:8536;
|
proxy_pass http://0.0.0.0:8536;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
@ -67,6 +64,9 @@ server {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
|
# Rate limit
|
||||||
|
limit_req zone=lemmy_ratelimit burst=30 nodelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Redirect pictshare images to pictrs
|
# Redirect pictshare images to pictrs
|
||||||
|
@ -74,6 +74,14 @@ server {
|
||||||
return 301 /pictrs/image/$1;
|
return 301 /pictrs/image/$1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Separate location block to disable rate limiting for images
|
||||||
|
location /pictrs {
|
||||||
|
proxy_pass http://0.0.0.0:8536/pictrs;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
}
|
||||||
|
|
||||||
location /iframely/ {
|
location /iframely/ {
|
||||||
proxy_pass http://0.0.0.0:8061/;
|
proxy_pass http://0.0.0.0:8061/;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|
Loading…
Reference in a new issue