Problem after latest upgrade nginx: [emerg] unknown "https"

Discussion in 'General' started by nackgr, Feb 28, 2013.

  1. nackgr

    nackgr New Member

    Hello after latest update i get that error!


    nginx: [emerg] unknown "https" variable nginx: configuration file /etc/nginx/nginx.conf test failed
     
  2. nackgr

    nackgr New Member

    solved by remove

    from
    /etc/nginx/sites-available/apps.vhost
    /etc/nginx/sites-enabled/000-apps.vhost

    the lines

    # fastcgi_param HTTPS $server_https;
     
  3. falko

    falko Super Moderator ISPConfig Developer

    Did you use a custom template? We don't use $server_https in the default templates.
     
  4. Rockdrala

    Rockdrala New Member

    I used i686 noarch on centos 6.3. Would that cause this? Also troubleshooting same error.

    Actually my apps.vhost looked different.
    Code:
    [root@node1 sites-available]# vi apps.vhost
                   fastcgi_param   CONTENT_LENGTH          $content_length;
    
                   fastcgi_param   SCRIPT_FILENAME         $request_filename;
                   fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
                   fastcgi_param   REQUEST_URI             $request_uri;
                   fastcgi_param   DOCUMENT_URI            $document_uri;
                   fastcgi_param   DOCUMENT_ROOT           $document_root;
                   fastcgi_param   SERVER_PROTOCOL         $server_protocol;
    
                   fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
                   fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;
    
                   fastcgi_param   REMOTE_ADDR             $remote_addr;
                   fastcgi_param   REMOTE_PORT             $remote_port;
                   fastcgi_param   SERVER_ADDR             $server_addr;
                   fastcgi_param   SERVER_PORT             $server_port;
                   fastcgi_param   SERVER_NAME             $server_name;
    
                   [B]fastcgi_param   HTTPS                   $https;[/B]
    
    should I remove
    Code:
     fastcgi_param   HTTPS                   $https;
     
    Last edited: Mar 9, 2013
  5. Rockdrala

    Rockdrala New Member

    Its actually posted in my apps.vhost like 4 times.



    Would commenting them out fix my server refused connection error for the ispconfig panel?
     
    Last edited: Mar 9, 2013
  6. Rockdrala

    Rockdrala New Member

    netstat tap

    Code:
    There are no updates available for ISPConfig 3.0.5.1
    [root@node1 sites-available]# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address               Foreign Address             Stat                                                                             e       PID/Program name
    tcp        0      0 *:amqp                      *:*                         LIST                                                                             EN      2048/qpidd
    tcp        0      0 localhost:cslistener        *:*                         LIST                                                                             EN      1949/php-fpm
    tcp        0      0 localhost:10024             *:*                         LIST                                                                             EN      1787/amavisd (maste
    tcp        0      0 *:408                     *:*                         LIST                                                                             EN      1494/sshd
    tcp        0      0 localhost:10025             *:*                         LIST                                                                             EN      1894/master
    tcp        0      0 *:mysql                     *:*                         LIST                                                                             EN      1725/mysqld
    tcp        0      0 *:sunrpc                    *:*                         LIST                                                                             EN      1262/rpcbind
    tcp        0      0 localhost:9012              *:*                         LIST                                                                             EN      1949/php-fpm
    tcp        0      0 *:ftp                       *:*                         LIST                                                                             EN      2037/pure-ftpd (SER
    tcp        0      0 localhost:9013              *:*                         LIST                                                                             EN      1949/php-fpm
    tcp        0      0 *:50869                     *:*                         LIST                                                                             EN      1281/rpc.statd
    tcp        0      0 192.168.1.101:domain        *:*                         LIST                                                                             EN      1242/named
    tcp        0      0 localhost:domain            *:*                         LIST                                                                             EN      1242/named
    tcp        0      0 localhost:ipp               *:*                         LIST                                                                             EN      1375/cupsd
    tcp        0      0 *:smtp                      *:*                         LIST                                                                             EN      1894/master
    tcp        0      0 localhost:rndc              *:*                         LIST                                                                             EN      1242/named
    tcp        0      0 localhost:mysql             localhost:37016             ESTA                                                                             BLISHED 1725/mysqld
    tcp        0   1252 192.168.1.11:4028         Kim-blahblah:60161 ESTA                                                                             BLISHED 2384/sshd
    tcp       67      0 localhost:47764             localhost:10025             CLOS                                                                             E_WAIT  1946/amavisd (ch1-a
    tcp        0      0 localhost:37216             localhost:mysql             ESTA                                                                             BLISHED 1946/amavisd (ch1-a
    tcp        0      0 *:amqp                      *:*                         LIST                                                                             EN      2048/qpidd
    tcp        0      0 *:408                     *:*                         LIST                                                                             EN      1494/sshd
    tcp        0      0 *:pop3                      *:*                         LIST                                                                             EN      1813/couriertcpd
    tcp        0      0 *:imap                      *:*                         LIST                                                                             EN      1800/couriertcpd
    tcp        0      0 *:sunrpc                    *:*                         LIST                                                                             EN      1262/rpcbind
    tcp        0      0 *:55540                     *:*                         LIST                                                                             EN      1281/rpc.statd
    tcp        0      0 *:ftp                       *:*                         LIST                                                                             EN      2037/pure-ftpd (SER
    tcp        0      0 *:domain                    *:*                         LIST                                                                             EN      1242/named
    tcp        0      0 localhost:ipp               *:*                         LIST                                                                             EN      1375/cupsd
    tcp        0      0 *:smtp                      *:*                         LIST                                                                             EN      1894/master
    tcp        0      0 localhost:rndc              *:*                         LIST                                                                             EN      1242/named
    tcp        0      0 *:imaps                     *:*                         LIST                                                                             EN      1807/couriertcpd
    tcp        0      0 *:pop3s                     *:*                         LIST         
     
  7. Rockdrala

    Rockdrala New Member

    Code:
    [root@node1 sites-available]# /etc/init.d/nginx reload
    [root@node1 sites-available]# /etc/init.d/nginx start
    Starting nginx: nginx: [emerg] unknown "https" variable
                                                               [[COLOR="Red"]FAILED[/COLOR]]
    
    Bleh
     
  8. Rockdrala

    Rockdrala New Member

    Commented out all four lines in apps.vhost ( I dont have a 000-apps.vhost)

    Now getting

    Code:
    Starting nginx: nginx: [warn] conflicting server name "_" on 0.0.0.0:80, ignored
                                                               [  [COLOR="Lime"]OK [/COLOR] ]
    
     
  9. Rockdrala

    Rockdrala New Member

    All sites are back up, control panel back up. Why did I have to comment these out? Isn't NGINX suppose to handle the https request?


    I fixed it but im confooooooooooooooooooooosed (^_^)

    btw good to be back on here

    <3
    Also

    I'm seeing people post that they have 000-apps.vhost, 000-ispconfig.conf, 900-example1.com.vhost, 900-example2.com.vhost, 900-example3.com.vhost in their sites available file.

    I don't have numbers appended in front of my sites. Is this going to be a problem for my configuration?
     
    Last edited: Mar 9, 2013
  10. Rockdrala

    Rockdrala New Member

    problem after reboot.

    Something uncommented the four $https lines I commented after reboot. I need to know if this file(apps.vhost) is generated by something upon reboot because it crashed my nginx again. I can really use some insight on this here falko/timme.


    it caused the same net connection refused until I commented back out the fast cgi https lines again. What generates this file so I can set it to not regenerate an uncommented line again.
     
  11. Rockdrala

    Rockdrala New Member

    I'm still having problems. I rechecked my settings per the ispconfig setup.

    Every time I try to restart NGINX I get:
    Code:
    nginx: [emerg] unknown "https" variable
    nginx: configuration file /etc/nginx/nginx.conf test failed
    
    I am specifying that I am using https in my nginx.conf


    Code:
    [root@node1 cgi-bin]# vi /etc/nginx/nginx.conf
    
    http {
            ## Detect when HTTPS is used
        map $scheme $fastcgi_https {
          default off;
          https on;
        }
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
    
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
    
        access_log  /var/log/nginx/access.log  main;
    
        sendfile        on;
        #tcp_nopush     on;
    
        #keepalive_timeout  0;
        keepalive_timeout  65;
    
        #gzip  on;
    
    
    wtf am I doing wrong? Why do I have to edit apps.vhost. to and comment out 
    https variables to get my sites backup?
    
    HALP Falko and Timme
     
    Last edited: Mar 12, 2013
  12. Rockdrala

    Rockdrala New Member

    Reinstalled Still Error

    Im still getting a Starting nginx: nginx: [emerg] unknown "https" variable
    Fresh install following per http://www.howtoforge.com/perfect-server-centos-6.3-x86_64-nginx-courier-ispconfig-3-p7


    The
    Code:
    http {
            ## Detect when HTTPS is used
            map $scheme $fastcgi_https {
              default off;
              https on;
            }
    
    is added as instructed in the guide.

    The nginx version is 1.0.15 and ispconfig is 3.0.5.1

    Code:
    
    [root@node1 install]# cat /var/log/nginx/error.log
    
    2013/03/14 13:49:37 [emerg] 22414#0: unknown "https" variable
    2013/03/14 13:49:40 [emerg] 22478#0: unknown "https" variable
    2013/03/14 13:54:32 [emerg] 22664#0: unknown "https" variable
    2013/03/14 13:54:36 [emerg] 22674#0: unknown "https" variable
    2013/03/14 13:54:37 [emerg] 22684#0: unknown "https" variable
    2013/03/14 14:12:50 [emerg] 23329#0: unknown "https" variable
    2013/03/14 14:23:44 [emerg] 23698#0: unknown "https" variable
    2013/03/14 14:52:44 [emerg] 24649#0: unknown "https" variable
    2013/03/14 15:01:32 [emerg] 25002#0: unknown "https" variable
    
     
    Last edited: Mar 14, 2013
  13. Rockdrala

    Rockdrala New Member

    http://serverfault.com/questions/484363/nginx-unknown-https-variable

    This forum says to upgrade to 1.2.7 but the os wont let it after adding the repository it requested.

    Code:
    [root@node1 ~]# vi /etc/yum.repos.d/nginx.repo
    [root@node1 ~]# yum upgrade nginx
    Loaded plugins: fastestmirror, priorities, security
    Loading mirror speeds from cached hostfile
     * base: mirror.sanctuaryhost.com
     * epel: mirror.steadfast.net
     * extras: mirrors.gigenet.com
     * rpmforge: mirror.teklinks.com
     * updates: mirror.steadfast.net
    http://nginx.org/packages/centos/6.4/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: nginx. Please verify its path and try again
    [root@node1 ~]# vi /etc/yum.repos.d/nginx.repo
    [root@node1 ~]# yum upgrade nginx
    Loaded plugins: fastestmirror, priorities, security
    Loading mirror speeds from cached hostfile
     * base: mirror.sanctuaryhost.com
     * epel: mirror.steadfast.net
     * extras: mirrors.gigenet.com
     * rpmforge: mirror.teklinks.com
     * updates: mirror.steadfast.net
    nginx                                                    | 1.3 kB     00:00
    nginx/primary                                            | 5.0 kB     00:00
    nginx                                                                     35/35
    1370 packages excluded due to repository priority protections
    Setting up Upgrade Process
    No Packages marked for Update
    [root@node1 ~]# yum install nginx
    Loaded plugins: fastestmirror, priorities, security
    Loading mirror speeds from cached hostfile
     * base: mirror.sanctuaryhost.com
     * epel: mirror.steadfast.net
     * extras: mirrors.gigenet.com
     * rpmforge: mirror.teklinks.com
     * updates: mirror.steadfast.net
    1370 packages excluded due to repository priority protections
    Setting up Install Process
    Package nginx-1.0.15-3.el6.x86_64 already installed and latest version
    Nothing to do
    

    I cant figure it out.
     
  14. Rockdrala

    Rockdrala New Member

    After enabling the Remi repository and setting the nginx repository to priority 1 I finally got upgraded to 1.2.7.


    Code:
    nginx                                                    | 1.3 kB     00:00
    remi                                                     | 2.9 kB     00:00
    remi/primary_db                                          | 494 kB     00:01
    1421 packages excluded due to repository priority protections
    Setting up Upgrade Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package nginx.x86_64 0:1.0.15-3.el6 will be updated
    ---> Package nginx.x86_64 0:1.2.7-1.el6.ngx will be an update
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================
     Package        Arch            Version                    Repository      Size
    ================================================================================
    Updating:
     nginx          x86_64          1.2.7-1.el6.ngx            nginx          364 k
    
    Transaction Summary
    ================================================================================
    Upgrade       1 Package(s)
    
    Total download size: 364 k
    Is this ok [y/N]: y
    Downloading Packages:
    nginx-1.2.7-1.el6.ngx.x86_64.rpm                         | 364 kB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Updating   : nginx-1.2.7-1.el6.ngx.x86_64                                 1/2
    warning: /etc/nginx/fastcgi_params created as /etc/nginx/fastcgi_params.rpmnew
    warning: /etc/nginx/nginx.conf created as /etc/nginx/nginx.conf.rpmnew
      Cleanup    : nginx-1.0.15-3.el6.x86_64                                    2/2
      Verifying  : nginx-1.2.7-1.el6.ngx.x86_64                                 1/2
      Verifying  : nginx-1.0.15-3.el6.x86_64                                    2/2
    
    Updated:
      nginx.x86_64 0:1.2.7-1.el6.ngx
    

    Now to figure out what ...
    Code:
     /etc/nginx/fastcgi_params.rpmnew
    warning: /etc/nginx/nginx.conf created as /etc/nginx/nginx.conf.rpmnew
    broke.
     
  15. Rockdrala

    Rockdrala New Member

    Found the problem. Falko your guide causes the install of nginx 1.0.15 which is too old to use with parameters of vhost generated by by your new ispconfig versions.

    If you update the repository in your guide to install 1.2.7 instead it works fine.

    All sites are back up. No errors. "WHEW"
     
  16. falko

    falko Super Moderator ISPConfig Developer

    Ok, I guess this happened because of the line

    Code:
    fastcgi_param   HTTPS                   $https;
    in the apps vhost.
     
  17. Rockdrala

    Rockdrala New Member

    You are correct sir =)
     
  18. PermaNoob

    PermaNoob New Member

    I have the same problem, but his fix:
    did nothing. Is there another fix?
     

Share This Page