1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lemmy_ynh.git synced 2024-09-03 19:36:09 +02:00
This commit is contained in:
Éric Gaspar 2023-06-23 23:17:27 +02:00
parent ed44d07c13
commit ad37b7d4b4
2 changed files with 9 additions and 7 deletions

View file

@ -1,3 +1,5 @@
#https://github.com/LemmyNet/lemmy-ansible/blob/main/templates/nginx_internal.conf
#limit_req_zone $binary_remote_addr zone=lemmy_ratelimit:10m rate=1r/s;
# Only connect to this site via HTTPS for the two years
@ -19,7 +21,11 @@ location / {
# lemmy_port: 8536
set $proxpass "http://127.0.0.1:__PORT_UI__";
if ($http_accept ~ "^application/.*$") {
if ($http_accept ~ "^application/activity+json") {
set $proxpass "http://127.0.0.1:__PORT__";
}
if ($http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") {
set $proxpass "http://127.0.0.1:__PORT__";
}
if ($request_method = POST) {
@ -28,7 +34,6 @@ location / {
proxy_pass $proxpass;
rewrite ^(.+)/+$ $1 permanent;
# Send actual client IP upstream
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
@ -42,10 +47,7 @@ location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Rate limit
# limit_req zone=lemmy_ratelimit burst=30 nodelay;
# Add IP forwarding headers
# Send actual client IP upstream
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

View file

@ -51,7 +51,7 @@ ram.runtime = "50M"
[resources.ports]
main.default = 8536
ui.default = 8537
ui.default = 1235
[resources.system_user]