infrastructure/njallavps/swag/nginx/site-confs/lemmy.conf
2023-01-23 15:23:38 +00:00

41 lines
1006 B
Plaintext

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name lemmy.anonymousland.org;
include /config/nginx/ssl.conf;
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app lemmy-ui;
set $upstream_port 1234;
set $upstream_proto http;
if ($request_method = POST) {
set $upstream_app lemmy;
set $upstream_port 8536;
}
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) {
set $upstream_app lemmy;
set $upstream_port 8536;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Redirect pictshare images to pictrs
location ~ /pictshare/(.*)$ {
return 301 /pictrs/image/$1;
}
}