parent
ed9e91345a
commit
28eade6168
3 changed files with 134 additions and 138 deletions
|
@ -1 +1 @@
|
|||
Subproject commit f5d6f0eabafd559417bf8f203fd655f7858bffcf
|
||||
Subproject commit 454debaede4cc932ac15fea9bf620cf1daf1ae4c
|
|
@ -34,6 +34,7 @@ services:
|
|||
networks:
|
||||
- lemmyinternal
|
||||
restart: always
|
||||
environment:
|
||||
- RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy_apub=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_actor=info,lemmy_db_views_moderator=info,lemmy_routes=info,lemmy_utils=info,lemmy_websocket=info"
|
||||
volumes:
|
||||
- ./lemmy.hjson:/config/config.hjson
|
||||
|
|
|
@ -1,22 +1,18 @@
|
|||
# nginx example config
|
||||
# replace {{yourdomain}} and review the certbot/letsencrypt config
|
||||
worker_processes 1;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
limit_req_zone $binary_remote_addr zone={{yourdomain}}_ratelimit:10m rate=1r/s;
|
||||
|
||||
upstream lemmy {
|
||||
limit_req_zone $binary_remote_addr zone={{yourdomain}}_ratelimit:10m rate=1r/s;
|
||||
|
||||
upstream lemmy {
|
||||
# this needs to map to the lemmy (server) docker service hostname
|
||||
server "lemmy:8536";
|
||||
}
|
||||
upstream lemmy-ui {
|
||||
}
|
||||
upstream lemmy-ui {
|
||||
# this needs to map to the lemmy-ui docker service hostname
|
||||
server "lemmy-ui:1234";
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
server {
|
||||
# allow letsencrypt challenge
|
||||
# redirect everything else to 443
|
||||
listen 80;
|
||||
|
@ -28,9 +24,9 @@ http {
|
|||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name {{yourdomain}};
|
||||
|
@ -137,16 +133,15 @@ http {
|
|||
location ~ /pictshare/(.*)$ {
|
||||
return 301 /pictrs/image/$1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Anonymize IP addresses
|
||||
# https://www.supertechcrew.com/anonymizing-logs-nginx-apache/
|
||||
map $remote_addr $remote_addr_anon {
|
||||
# Anonymize IP addresses
|
||||
# https://www.supertechcrew.com/anonymizing-logs-nginx-apache/
|
||||
map $remote_addr $remote_addr_anon {
|
||||
~(?P<ip>\d+\.\d+\.\d+)\. $ip.0;
|
||||
~(?P<ip>[^:]+:[^:]+): $ip::;
|
||||
127.0.0.1 $remote_addr;
|
||||
::1 $remote_addr;
|
||||
default 0.0.0.0;
|
||||
}
|
||||
access_log /var/log/nginx/access.log combined;
|
||||
}
|
||||
access_log /var/log/nginx/access.log combined;
|
||||
|
|
Loading…
Reference in a new issue