Add extra nginx configs

That's kinda important
This commit is contained in:
Norbi Peti 2024-06-12 01:03:02 +02:00
parent bf4580154e
commit ab326d8191
3 changed files with 7 additions and 4 deletions

View file

@ -8,7 +8,7 @@ location /upload/ {
client_max_body_size 104857616; # 100MB + 16 bytes (see Prosody config)
proxy_request_buffering off;
proxy_http_version 1.1;
proxy_pass http://localhost:__PORT__;
proxy_pass http://localhost:__PORT_HTTP__;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;

View file

@ -27,12 +27,13 @@ install_certificates() {
### Add Nginx configuration for other domains. This is necessary because at the moment Snikket requires two additional
### subdomains to function fully. Does not reload Nginx configuration.
### Usage: add_extra_nginx_config <domain>
### Usage: add_extra_nginx_config <subdomain>
add_extra_nginx_config() {
local extra_domain="$1"
local extra_subdomain="$1"
local extra_domain=$extra_subdomain.$domain
local finalnginxconf="/etc/nginx/conf.d/$extra_domain.d/$app.conf"
ynh_add_config --template="nginx.$extra_domain.conf" --destination="$finalnginxconf"
ynh_add_config --template="nginx.$extra_subdomain.conf" --destination="$finalnginxconf"
ynh_store_file_checksum --file="$finalnginxconf"
}

View file

@ -162,6 +162,8 @@ yunohost service add "$app" --description="Chat that is simple, secure, and priv
ynh_add_systemd_config --service="$app-web" --template="web.service"
yunohost service add "$app-web" --description="Chat that is simple, secure, and private" --log="/var/log/$app-web/$app-web.log"
# Create a dedicated NGINX config using the conf/nginx.conf template
add_extra_nginx_config share
add_extra_nginx_config groups
ynh_add_nginx_config
#=================================================