nginx plugin error after changes

    • OMV 3.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • nginx plugin error after changes

      unable to get nginx back up and running on new install - had web pages setup in external USB attached drive - did '# apt-get remove openmediavault-nginx' and re-installed the plugin. mapped to new install and upon starting up nginx get the following error:

      Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; nginx -t 2>&1' with exit code '1': nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: [emerg] socket() [::]:82 failed (97: Address family not supported by protocol) nginx: configuration file /etc/nginx/nginx.conf test failed

      or

      Error #0:exception 'OMV\ExecException' with message 'Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; nginx -t 2>&1' with exit code '1': nginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: [emerg] socket() [::]:85 failed (97: Address family not supported by protocol)nginx: configuration file /etc/nginx/nginx.conf test failed' in /usr/share/php/openmediavault/system/process.inc:175Stack trace:#0 /usr/share/openmediavault/engined/module/webserver.inc(40): OMV\System\Process->execute()#1 /usr/share/openmediavault/engined/rpc/config.inc(168): OMVModuleNginxAbstract->applyConfig()#2 [internal function]: OMVRpcServiceConfig->applyChanges(Array, Array)#3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(124): call_user_func_array(Array, Array)#4 /usr/share/php/openmediavault/rpc/serviceabstract.inc(150): OMV\Rpc\ServiceAbstract->callMethod('applyChanges', Array, Array)#5 /usr/share/php/openmediavault/rpc/serviceabstract.inc(528): OMV\Rpc\ServiceAbstract->OMV\Rpc\{closure}('/tmp/bgstatusle...', '/tmp/bgoutput5G...')#6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(151): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))#7 /usr/share/openmediavault/engined/rpc/config.inc(213): OMV\Rpc\ServiceAbstract->callMethodBg('applyChanges', Array, Array)#8 [internal function]: OMVRpcServiceConfig->applyChangesBg(Array, Array)#9 /usr/share/php/openmediavault/rpc/serviceabstract.inc(124): call_user_func_array(Array, Array)#10 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('applyChangesBg', Array, Array)#11 /usr/sbin/omv-engined(536): OMV\Rpc\Rpc::call('Config', 'applyChangesBg', Array, Array, 1)#12 {main}

      nginx.conf:

      user www-data;
      worker_processes 4;
      pid /run/nginx.pid;

      events {
      worker_connections 768;
      # multi_accept on;
      }

      http {

      ##
      # Basic Settings
      ##

      sendfile on;
      tcp_nopush on;
      tcp_nodelay on;
      keepalive_timeout 65;
      types_hash_max_size 2048;
      # server_tokens off;

      # server_names_hash_bucket_size 64;
      # server_name_in_redirect off;

      include /etc/nginx/mime.types;
      default_type application/octet-stream;

      ##
      # SSL Settings
      ##

      ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
      ssl_prefer_server_ciphers on;

      ##
      # Logging Settings
      ##

      access_log /var/log/nginx/access.log;
      error_log /var/log/nginx/error.log;

      ##
      # Gzip Settings
      ##

      gzip on;
      gzip_disable "msie6";

      # gzip_vary on;
      # gzip_proxied any;
      # gzip_comp_level 6;
      # gzip_buffers 16 8k;
      # gzip_http_version 1.1;
      # gzip_types text/plain text/css application/json application/javascrip$

      ##
      # Virtual Host Configs
      ##

      include /etc/nginx/conf.d/*.conf;
      include /etc/nginx/sites-enabled/*;
      }


      #mail {
      # # See sample authentication script at:
      # # wiki.nginx.org/ImapAuthenticateWithApachePhpScript
      #
      # # auth_http localhost/auth.php;
      # # pop3_capabilities "TOP" "USER";
      # # imap_capabilities "IMAP4rev1" "UIDPLUS";
      #
      # server {
      # listen localhost:110;
      # protocol pop3;
      # proxy on;
      # }
      #
      # server {
      # listen localhost:143;
      # protocol imap;
      # proxy on;
      # }
      #}

      The post was edited 3 times, last by jeffbarclay ().

    • Well we also need to see the virtual hosts.
      Those are stored in the following folders:

      Source Code

      1. ##
      2. # Virtual Host Configs
      3. ##
      4. include /etc/nginx/conf.d/*.conf;
      5. include /etc/nginx/sites-enabled/*;



      My first assumption is, that this is due to a new nginx version.
      In the previous one the listen statements looked like this:

      Source Code

      1. server {
      2. listen 80;
      3. root /var/www/root/;
      4. }
      But now this syntax changed to:

      Source Code

      1. server {
      2. listen [::]:80;
      3. root /var/www/root/;
      4. }
      And this is again due to the fact that nginx now listens on IPv4 and IPv6. Therefore you define your ports in IPv6 syntx, but also the IPv4 port is listen on.

      Hopefully this helps
      LouBen3010
    • in the sites-enabled zzz-omg-nginx file the server has:



      Source Code

      1. server {
      2. Listen :82;
      3. listen [::]:82;
      4. root /var/www/root/;
      5. }
      If I remove the listen [::]:80; line the web page loads, however the OMV GUI will not exit the yellow "Apply Changes" notice. If I confirm the zzz-omg-nginx file is overwritten with default IPv6 listen lines.

      In my main config I am only using IPv4 and have disabled IPv6 since I’m using static IP address for this Pi box.

      /etc/nginc/conf.d/zzz-omv-nginx.conf contains the line: server_names_hash_bucket_size 32;

      The post was edited 3 times, last by jeffbarclay: added more info and file content ().

    • The config file is created when the changes are made, if you try to confirm/accept the changes you get the error I listed above. If you don’t accept the confirm message the file remains with the erroneous line listen[::]:80, and the confirm notice never goes away. At this point you can edit and save the file, but no other changes or updates can be made to OMV. If you ever dismiss the “confirm” message then the file is deleted and reverts back to default.

      If you just recreate the correct config file via CLI then the web interface fails to load and the Nginx that serves the web GUI fails.