How do you get to the Nginx configuration
-
I i decided to get a website up so i can play with the files but i've ran into a snag. How do you edit the nginx configuration file? My website still needs the port number.
I've been reading all of your tutorials but this step is usually unexplained because it's too easy.
-
What do you mean by the nginx configuration file? Are you using nginx to route to your nodebb setup?
-
I haven't been using nginx, however I should be. Have you tried the nginx guide in the NodeBB Github Wiki?
-
@kevin, the nginx configuration files are placed differently depending on the operating system you are using.
Perhaps try
/etc/nginx
?$ cd /etc/nginx/ $ ls # you should see a "sites-enabled" directory, maybe?
Put your file in
sites-enabled
. -
This post is deleted!
-
@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
-
@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.
-
@kevin You can insert the given directive to the nginx.conf file
First open the configuration file:
nano /etc/nginx/nginx.confThen 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.
-
@kevin that's somewhat surprising, but you can still use 128.
-
@kevin nice, welcome to the glorious world of unnoticeable comment characters!