Merge branch 'main' into peertube
This commit is contained in:
commit
01dd2b5100
|
@ -7,10 +7,10 @@
|
|||
include_tasks: config.yml
|
||||
|
||||
- name: "[NGINX] - Set SSL configuration"
|
||||
include: ssl.yml
|
||||
include_tasks: ssl.yml
|
||||
|
||||
- name: '[NGINX] - Deploy TOR for onion hidden services'
|
||||
include: tor.yml
|
||||
include_tasks: tor.yml
|
||||
when: enable_tor == 'true'
|
||||
|
||||
- name: '[NGINX] - Create onion addresses'
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
limit_req_zone $binary_remote_addr zone={{ item.name }}_ratelimit:10m rate=1r/s;
|
||||
|
||||
{% extends "core.j2" %}
|
||||
|
||||
{% block extra_upstreams %}
|
||||
upstream lemmy {
|
||||
server "{{ item.upstream_name }}:{{ item.lemmy_port }}";
|
||||
}
|
||||
upstream lemmy-ui {
|
||||
server "{{ item.upstream_name }}:{{ item.lemmy_ui_port }}";
|
||||
}
|
||||
{% endblock %}
|
||||
{% block headers %}
|
||||
|
||||
# Various content security headers
|
||||
|
@ -20,12 +27,13 @@ location / {
|
|||
# lemmy_ui_port: 1235
|
||||
# lemmy_port: 8536
|
||||
|
||||
set $proxpass {{ item.upstream_proto }}://{{ item.upstream_name }}:{{ lemmy_ui_port }};
|
||||
if ($http_accept ~ "^application/.*$") {
|
||||
set $proxpass {{ item.upstream_proto }}://{{ item.upstream_name }}:{{ lemmy_port }};
|
||||
set $proxpass "{{ item.upstream_proto }}://lemmy-ui";
|
||||
|
||||
if ($http_accept ~ "application/activity+json") {
|
||||
set $proxpass "{{ item.upstream_proto }}://lemmy";
|
||||
}
|
||||
if ($request_method = POST) {
|
||||
set $proxpass {{ item.upstream_proto }}://{{ item.upstream_name }}:{{ lemmy_port }};
|
||||
if ($request_method = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") {
|
||||
set $proxpass "{{ item.upstream_proto }}://lemmy";
|
||||
}
|
||||
proxy_pass $proxpass;
|
||||
|
||||
|
@ -39,7 +47,7 @@ location / {
|
|||
|
||||
# backend
|
||||
location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) {
|
||||
proxy_pass {{ item.upstream_proto }}://{{ item.upstream_name }}:{{ lemmy_port }};
|
||||
proxy_pass {{ item.upstream_proto }}://lemmy;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
|
Loading…
Reference in New Issue