• Resolved Alessandro

    (@pinoperino)


    Hello and thank you for your awesome plugin.
    I’m trying to figure out what I’m doing wrong because I’m not able to make it works. I’m using YunoHost and I’m not sure if I have to copy and paste the nginx configuration in the FAQ on top of this nginx file or if I have to modify it in some way.

    Yunohost is widely used so this is a standard information that can be usefull to other people I think.

    
    map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
    }
    
    server {
        listen 80;
        listen [::]:80;
        server_name domain.com xmpp-upload.domain.com;
    
        access_by_lua_file /usr/share/ssowat/access.lua;
    
        include /etc/nginx/conf.d/acme-challenge.conf.inc;
    
        include /etc/nginx/conf.d/domain.com.d/*.conf;
    
        location /yunohost {
            return 301 https://$http_host$request_uri;
        }
    
        location ^~ '/.well-known/ynh-diagnosis/' {
            alias /tmp/.well-known/ynh-diagnosis/;
        }
    
        location ^~ '/.well-known/autoconfig/mail/' {
            alias /var/www/.well-known/domain.com/autoconfig/mail/;
        }
    
        access_log /var/log/nginx/domain.com-access.log;
        error_log /var/log/nginx/domain.com-error.log;
    }
    
    server {
    
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name domain.com;
    
        include /etc/nginx/conf.d/security.conf.inc;
    
        ssl_certificate /etc/yunohost/certs/domain.com/crt.pem;
        ssl_certificate_key /etc/yunohost/certs/domain.com/key.pem;
    
        location ^~ '/.well-known/autoconfig/mail/' {
            alias /var/www/.well-known/domain.com/autoconfig/mail/;
        }
    
        access_by_lua_file /usr/share/ssowat/access.lua;
    
        include /etc/nginx/conf.d/domain.com.d/*.conf;
    
        include /etc/nginx/conf.d/yunohost_sso.conf.inc;
        include /etc/nginx/conf.d/yunohost_admin.conf.inc;
        include /etc/nginx/conf.d/yunohost_api.conf.inc;
    
        access_log /var/log/nginx/domain.com-access.log;
        error_log /var/log/nginx/domain.com-error.log;
    }
    
    # vhost dedicated to XMPP http_upload
    server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name xmpp-upload.domain.com;
        root /dev/null;
    
        location /upload/ {
            alias /var/xmpp-upload/domain.com/upload/;
            # Pass all requests to metronome, except for GET and HEAD requests.
            limit_except GET HEAD {
              proxy_pass https://localhost:5290;
            }
    
            include proxy_params;
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Methods' 'HEAD, GET, PUT, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'Authorization';
            add_header 'Access-Control-Allow-Credentials' 'true';
            client_max_body_size 105M; # Choose a value a bit higher than the max $
        }
    
        include /etc/nginx/conf.d/security.conf.inc;
    
        ssl_certificate /etc/yunohost/certs/domain.com/crt.pem;
        ssl_certificate_key /etc/yunohost/certs/domain.com/key.pem;
    
        access_log /var/log/nginx/xmpp-upload.domain.com-access.log;
        error_log /var/log/nginx/xmpp-upload.domain.com-error.log;
    }
    

    Thank you,
    Alessandro

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hello @pinoperino,

    Thanks for your message.

    I tested the configuration given in the plugin FAQ on Nginx in Ubuntu. Everything worked fine. I haven’t had any reports from YunoHost users so far, so I can’t say anything else.

    Please contact your server administrator and try to explain the situation.

    Best,
    Mateusz

Viewing 1 replies (of 1 total)
  • The topic ‘Nginx configuration for YunoHost’ is closed to new replies.