How do you get to the Nginx configuration


  • @barveyhirdman said:

    @kevin you shouldn't edit /etc/nginx/sites-enabled directly.

    The normal flow of enabling sites is

    • nano /etc/nginx/sites-available/<site-name>
    • write config
    • ln -s /etc/nginx/sites-available/<site-name> /etc/nginx/sites-enabled/<site-name>

    This creates a symbolic link to the file in sites-available. Anyway, the default config is usually in the default file, other than that a good convention can be <subdomain>.<domain>, or in your case just californiamotorcycleforum.com

    For some reason when I did the symbolic link nginx didn't pick it up, I had to just copy the file from sites-available to sites-enabled.


  • @skaughtx0r yeah sometimes it's the same for me, not sure what causes it. But yeah, if it doesn't work, you can just copy it. It's just more consistent if you edit the file in sites-available and not the one in sites-enabled directly.

  • GNU/Linux Admin

    @barveyhirdman Nice catch. Definitely use ln -s to link to the actual file in sites-available.

    @kevin -- just name it anything... no extension required either.


  • okay got the two files linked and in the right directory. nginx wont run though. gotta figure out that now.

  • GNU/Linux Admin

    @kevin - cool. Try this (using sudo or as root user): nginx -t

    It will check your nginx configuration file, and let you know what went wrong.


  •  [email protected]:~# sudo service nginx start
    Starting nginx: nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
    nginx: configuration file /etc/nginx/nginx.conf test failedmaybe?
    

  • @kevin You can insert the given directive to the nginx.conf file

    First open the configuration file:
    nano /etc/nginx/nginx.conf

    Then check if the directive server_names_hash_bucket_size already exists. If it does, just change the value to 32 or 64 if you still get the error with 32.

    If you don't have the given line, look for

    http {
    

    And add it to the next row:

    http {
        server_names_hash_bucket_size 32;
    

    (Or 64, as said above)

    Try to verify the config now, it should work.


  • whats funny is it already states 64.


  • @kevin that's somewhat surprising, but you can still use 128. ๐Ÿ˜„


  • fixed it. There was a hashtag in the line "server_names_hash_bucket_size " by default. just had to remove it.


  • @kevin nice, welcome to the glorious world of unnoticeable comment characters! ๐Ÿ˜„


  • thanks. hey do you get any notification if i respond without @'ing you?


  • I didn't get any, so I guess not. ๐Ÿ™‚


  • @barveyhirdman

    Now i have a different problem.

    You can see my site from

    californiamotorcyceforum.com and http://198.199.96.7:4567/

    if you look at it from the ip address everything works.
    If you look at it from the url while signed in, it'll still say "log in/register" and wont have access to the alerts/instant messaging.

    From the admin it wont let me change any settings.

  • GNU/Linux Admin

    Looks like you might need to upgrade nginx...

    When you type in nginx -V, what shows up? The version should be 1.3.13 or greater.


  • @julian no matter what I try to udate nginx, i get this after checking version:

    nginx version: nginx/1.1.19
    TLS SNI support enabled
    configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.1.19/debian/modules/nginx-auth-pam --add-module=/build/buildd/nginx-1.1.19/debian/modules/nginx-echo --add-module=/build/buildd/nginx-1.1.19/debian/modules/nginx-upstream-fair --add-module=/build/buildd/nginx-1.1.19/debian/modules/nginx-dav-ext-module

  • GNU/Linux Admin

    Yeah, this is what is causing problems on your NodeBB. Debian is a stable operating system, but their packages are very very old. You'll have to upgrade it before you can access your community without a port number.


  • @kevin you can upgrade Nginx to the latest version this way (as you have to use backports ๐Ÿ˜ž ๐Ÿ˜ž

    echo deb http://ftp.debian.org/debian wheezy-backports main contrib non-free >> /etc/apt/sources.list
    apt-get update
    aptitude -t wheezy-backports install nginx nginx-common nginx-full
    

    Maybe nginx-full is enough, I did it this way just to be sure. ๐Ÿ™‚


  • @BarveyHirdman Thanks. That did the trick.

    Unfortunately the problem's still the same. if you look at the website, it doesnt show that you are logged in. It doesnt show any of the statistics in the light colored boxes on the bottom. Very weird.

  • GNU/Linux Admin

    With a community so helpful, why would anybody need to use our premium SaaS ๐Ÿ˜ž (just kidding @BarveyHirdman, keep up the good work :D)

    Anyhow, did you restart nginx? ๐Ÿ™‚

Suggested Topics

| |