3 worker_connections 1024;
10 server "lemmy-ui:1234";
14 server_name localhost;
18 set $proxpass "http://lemmy-ui";
19 if ($http_accept = "application/activity+json") {
20 set $proxpass "http://lemmy";
22 if ($http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") {
23 set $proxpass "http://lemmy";
25 if ($request_method = POST) {
26 set $proxpass "http://lemmy";
30 rewrite ^(.+)/+$ $1 permanent;
32 # Send actual client IP upstream
33 proxy_set_header X-Real-IP $remote_addr;
34 proxy_set_header Host $host;
35 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
39 location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) {
40 proxy_pass "http://lemmy";
41 proxy_http_version 1.1;
42 proxy_set_header Upgrade $http_upgrade;
43 proxy_set_header Connection "upgrade";
45 # Add IP forwarding headers
46 proxy_set_header X-Real-IP $remote_addr;
47 proxy_set_header Host $host;
48 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;