35 lines
981 B
Nginx Configuration File
35 lines
981 B
Nginx Configuration File
# Based on the nginx config made available by Lemmy developers.
|
|
# https://github.com/LemmyNet/lemmy
|
|
|
|
worker_processes 1;
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
http {
|
|
upstream lemmy {
|
|
# this needs to map to the lemmy (server) docker service hostname
|
|
server "lemmy:8536";
|
|
}
|
|
|
|
server {
|
|
listen 8536;
|
|
# change if needed, this is facing the public web
|
|
server_name localhost;
|
|
server_tokens off;
|
|
|
|
# backend
|
|
location ~ ^/(api|pictrs|feeds|nodeinfo|version|.well-known) {
|
|
proxy_pass "http://lemmy";
|
|
# proxy common stuff
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
# 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;
|
|
}
|
|
}
|
|
}
|