Skip to content

Instantly share code, notes, and snippets.

@Death916
Created June 15, 2023 11:18
Show Gist options
  • Save Death916/6edcca3ec6c3df9df7301256963bade1 to your computer and use it in GitHub Desktop.
Save Death916/6edcca3ec6c3df9df7301256963bade1 to your computer and use it in GitHub Desktop.
location / {
# The default ports:
# lemmy_ui_port: 1236(not used here)
# lemmy_port: 8536
set $proxpass "http://100.117.212.36:1236";
if ($http_accept ~ "^application/.*$") {
set $proxpass "http://100.117.212.36:8536";
}
if ($request_method = POST) {
set $proxpass "http://100.117.212.36:8536";
}
proxy_pass $proxpass;
rewrite ^(.+)/+$ $1 permanent;
# 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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment