How do you get to the Nginx configuration


  • @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? ๐Ÿ™‚


  • @Julian lol. I know i feel bad but the hosting service just didnt seem like it was ready. If I could point a domain at it, and just start working on theming I totally would use it.


  • /etc/nginx/sites-available/californiamotorcycleforum & /etc/nginx/sites-enabled/californiamotorcycleforum

    upstream nodebb {
        server 198.199.96.7:4567
    }
    
    server {
        listen 80;
    
        server_name californiamotorcycleforum.com;
        root /path/to/nodebb/install;
    
        location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
    
            proxy_pass http://nodebb/;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
    

    /etc/nginx/sites-available/default

    # You may add here your
    # server {
    #	...
    # }
    # statements for each of your virtual hosts to this file
    
    ##
    # You should look at the following URL's in order to grasp a solid understanding
    # of Nginx configuration files in order to fully unleash the power of Nginx.
    # http://wiki.nginx.org/Pitfalls
    # http://wiki.nginx.org/QuickStart
    # http://wiki.nginx.org/Configuration
    #
    # Generally, you will want to move this file somewhere, and start with a clean
    # file but keep this around for reference. Or just disable in sites-enabled.
    #
    # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
    ##
    
    server {
    	#listen   80; ## listen for ipv4; this line is default and implied
    	#listen   [::]:80 default ipv6only=on; ## listen for ipv6
    
    	root /usr/share/nginx/www;
    	index index.html index.htm;
    
    	# Make site accessible from http://localhost/
    	server_name localhost;
    
    	location / {
    		# First attempt to serve request as file, then
    		# as directory, then fall back to index.html
    		try_files $uri $uri/ /index.html;
    		# Uncomment to enable naxsi on this location
    		# include /etc/nginx/naxsi.rules
    	}
    
    	location /doc/ {
    		alias /usr/share/doc/;
    		autoindex on;
    		allow 127.0.0.1;
    		deny all;
    	}
    
    	# Only for nginx-naxsi : process denied requests
    	#location /RequestDenied {
    		# For example, return an error code
    		#return 418;
    	#}
    
    	#error_page 404 /404.html;
    
    	# redirect server error pages to the static page /50x.html
    	#
    	#error_page 500 502 503 504 /50x.html;
    	#location = /50x.html {
    	#	root /usr/share/nginx/www;
    	#}
    
    	# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    	#
    	#location ~ \.php$ {
    	#	fastcgi_split_path_info ^(.+\.php)(/.+)$;
    	#	# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    	#
    	#	# With php5-cgi alone:
    	#	fastcgi_pass 127.0.0.1:9000;
    	#	# With php5-fpm:
    	#	fastcgi_pass unix:/var/run/php5-fpm.sock;
    	#	fastcgi_index index.php;
    	#	include fastcgi_params;
    	#}
    
    	# deny access to .htaccess files, if Apache's document root
    	# concurs with nginx's one
    	#
    	#location ~ /\.ht {
    	#	deny all;
    	#}
    }
    
    
    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #	listen 8000;
    #	listen somename:8080;
    #	server_name somename alias another.alias;
    #	root html;
    #	index index.html index.htm;
    #
    #	location / {
    #		try_files $uri $uri/ /index.html;
    #	}
    #}
    
    
    # HTTPS server
    #
    #server {
    #	listen 443;
    #	server_name localhost;
    #
    #	root html;
    #	index index.html index.htm;
    #
    #	ssl on;
    #	ssl_certificate cert.pem;
    #	ssl_certificate_key cert.key;
    #
    #	ssl_session_timeout 5m;
    #
    #	ssl_protocols SSLv3 TLSv1;
    #	ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
    #	ssl_prefer_server_ciphers on;
    #
    #	location / {
    #		try_files $uri $uri/ /index.html;
    #	}
    #}
    

    /etc/nginx/nginx.conf

    user www-data;
    worker_processes 4;
    pid /var/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;
    
    	##
    	# 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/x-javascript text/xml application/xml application/xml+rss text/javascript;
    
    	##
    	# nginx-naxsi config
    	##
    	# Uncomment it if you installed nginx-naxsi
    	##
    
    	#include /etc/nginx/naxsi_core.rules;
    
    	##
    	# nginx-passenger config
    	##
    	# Uncomment it if you installed nginx-passenger
    	##
    	
    	#passenger_root /usr;
    	#passenger_ruby /usr/bin/ruby;
    
    	##
    	# Virtual Host Configs
    	##
    
    	include /etc/nginx/conf.d/*.conf;
    	include /etc/nginx/sites-enabled/*;
    }
    
    
    #mail {
    #	# See sample authentication script at:
    #	# http://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;
    #	}
    #}
    

  • @kevin this seems fine, although root should be the actual path to your nodebb install, but don't think that changes anything.

    Could you paste the public/config.json file from your nodebb dir? If I'm not mistaken fresh configs only contain the relative_path item.


  • @BarveyHirdman

    /root/mynodebb/public/config.json

    {
        "relative_path": ""
    }
    

  • He will need to add the root path in for his nodebb install.
    Also, make sure you clear your cache. I was having problems with changes to NodeBB and nginx not taking effect until i cleared the cache.


  • @Scuzz, How do i do that?

Suggested Topics

| |