MotionEye - Outside access with SSL

  • server {

    listen 443 ssl;

    listen [::]:443 ssl;


    server_name motioneye.*;


    include /config/nginx/ssl.conf;


    client_max_body_size 0;


    # enable for ldap auth, fill in ldap details in ldap.conf

    #include /config/nginx/ldap.conf;


    # enable for Authelia

    #include /config/nginx/authelia-server.conf;



    location / {

    # enable the next two lines for http auth

    #auth_basic "Restricted";

    #auth_basic_user_file /config/nginx/.htpasswd;


    # enable the next two lines for ldap auth

    #auth_request /auth;

    #error_page 401 =200 /login;


    # enable for Authelia

    #include /config/nginx/authelia-location.conf;


    include /config/nginx/proxy.conf;

    resolver 127.0.0.11 valid=30s;

    set $upstream_app motioneye; # use ip instead of name if name is not working

    set $upstream_port 8765; # note: as trilium is sharing the same docker network as letsencrypt, internal port to be used

    set $upstream_proto http;

    proxy_pass $upstream_proto://$upstream_app:$upstream_port;


    }


    }

    Normally if its in red it's bad!!!


    Machine 1 - Dell OptiPlex 790 - Core i5-2400 3.10GHz - 16GB RAM - OMV5

    Machine 2 - Raspberry PI4 - ARMv7 - 2GB - OMV5

  • restart your swag container


    and try to reach motioneye with https://motioneye.yourdomain.duckdns.org/cams/

  • Seems like STUKguy is using subfolder, not subdomain.

    that was from your Nextcloud guide

    for this set up i am following what you both are saying

    Normally if its in red it's bad!!!


    Machine 1 - Dell OptiPlex 790 - Core i5-2400 3.10GHz - 16GB RAM - OMV5

    Machine 2 - Raspberry PI4 - ARMv7 - 2GB - OMV5

  • restart your swag container


    and try to reach motioneye with https://motioneye.yourdomain.duckdns.org/cams/

    Now im getting this when i look at the logs for SAWG


    But i cant see whats wrong

    Normally if its in red it's bad!!!


    Machine 1 - Dell OptiPlex 790 - Core i5-2400 3.10GHz - 16GB RAM - OMV5

    Machine 2 - Raspberry PI4 - ARMv7 - 2GB - OMV5

  • Sorry, I was assuming you were using subdomain method.

    You need to use the same method (subdomain or subfolder) for motioneye as you used for nextcloud.

    Thats ok, i wasent very clear when i posted so i have made up a subfolder.conf usinf the nextcloud one as a template. the text in red im assuming should be changed to motioneye?


    ## Version 2020/12/09

    # Assuming this container is called "swag", edit your nextcloud container's config

    # located at /config/www/nextcloud/config/config.php and add the following lines before the ");":

    # 'trusted_proxies' => ['swag'],

    # 'overwritewebroot' => '/nextcloud',

    # 'overwrite.cli.url' => 'https://your-domain.com/nextcloud',

    #

    # Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:

    # array (

    # 0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.

    # 1 => 'your-domain.com',

    # ),


    # Redirects for DAV clients

    location = /.well-known/carddav {

    return 301 $scheme://$host/nextcloud/remote.php/dav;

    }


    location = /.well-known/caldav {

    return 301 $scheme://$host/nextcloud/remote.php/dav;

    }


    location /motioneye {

    return 301 $scheme://$host/motioneye/;

    }


    location ^~ /motioneye/ {

    include /config/nginx/proxy.conf;

    resolver 127.0.0.11 valid=30s;

    set $upstream_app motioneye;

    set $upstream_port 443;

    set $upstream_proto https;

    proxy_pass $upstream_proto://$upstream_app:$upstream_port;


    rewrite /motioneye(.*) $1 break;

    proxy_max_temp_file_size 1024m;

    proxy_set_header Range $http_range;

    proxy_set_header If-Range $http_if_range;

    proxy_redirect off;

    proxy_ssl_session_reuse off;

    }

    Normally if its in red it's bad!!!


    Machine 1 - Dell OptiPlex 790 - Core i5-2400 3.10GHz - 16GB RAM - OMV5

    Machine 2 - Raspberry PI4 - ARMv7 - 2GB - OMV5

    • Offizieller Beitrag

    Those only apply to nextcloud.

  • Thank you, think i may need to abandon this as i just got this

    so in motioneye.subfolder.conf


    set $upstream_port was orignally set to 443 - which came up with Bad gateway

    then change to

    set $upstream_port was orignally set to 8765 - just had the loading symbol and "waiting for ****.duckdns.org" and then it would time out


    not sure what else todo? any ideas

    Normally if its in red it's bad!!!


    Machine 1 - Dell OptiPlex 790 - Core i5-2400 3.10GHz - 16GB RAM - OMV5

    Machine 2 - Raspberry PI4 - ARMv7 - 2GB - OMV5

  • So here is my Nextcloud


    and this is my motioneye

    everything looks correct

    Normally if its in red it's bad!!!


    Machine 1 - Dell OptiPlex 790 - Core i5-2400 3.10GHz - 16GB RAM - OMV5

    Machine 2 - Raspberry PI4 - ARMv7 - 2GB - OMV5

  • Thought i would try something completely differant today since trying to get this to run through th Nextcloud set up..


    Created a 2nd container called it Swag2

    Changed Swag from listening on port 443 to listening on port 500 (to prevent it messing with the other swag container

    Forwarded ports 500 to 192.168.68.114:8765 on my router

    Created/edted "motioneye.subdomain.conf" with the following from thie github forum

    Code
    server {
        listen 500;
        server_name motioneye;
        location /cams/ {
            proxy_pass http://192.168.68.114:8765/;
            proxy_read_timeout 120s;
            access_log off;
        }
    }

    Restarted swag2, went to check on the log file got this

    but that didnt work either, had a look around online for video/tutorails but nothing really help. I did ask the question on the Motioneye forums but was shot down.


    Any last suggestions before i abandon this?

    Normally if its in red it's bad!!!


    Machine 1 - Dell OptiPlex 790 - Core i5-2400 3.10GHz - 16GB RAM - OMV5

    Machine 2 - Raspberry PI4 - ARMv7 - 2GB - OMV5

  • it sort of worked for (interface was looking strange) with this config:


    Running a secound swag container is complicated. Its not advised...

  • it sort of worked for (interface was looking strange) with this config:


    Running a secound swag container is complicated. Its not advised...

    After I sent the last message I reverted to just one swag container, I tried the code you used but I had no luck.

    Normally if its in red it's bad!!!


    Machine 1 - Dell OptiPlex 790 - Core i5-2400 3.10GHz - 16GB RAM - OMV5

    Machine 2 - Raspberry PI4 - ARMv7 - 2GB - OMV5

  • Are the container still in a docker network together?

    Yes



    And do you still have the subdomain in the docker-compose.yml?

    yes, here is the compose file

    Normally if its in red it's bad!!!


    Machine 1 - Dell OptiPlex 790 - Core i5-2400 3.10GHz - 16GB RAM - OMV5

    Machine 2 - Raspberry PI4 - ARMv7 - 2GB - OMV5

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!