• @a_5mith Does your nginx.conf contain a line that looks like include /etc/nginx/sites-enabled/*; ? If not, the config might not be parsed, because the only files parsed are nginx.conf and any configuration files specified in include statements.

    EDIT: I'm not sure about your missing mime.types. You can just extract the default one from the zip, though. (it's in nginx-x.x.x/conf/)


  • @Xiph
    ##
    # Virtual Host Configs
    ##

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

    It does indeed. I will look into including the mine.types that way. If anyone else has any other suggestions while I'm doing that, I'm all ears.


  • @a_5mith So, I'm not entirely sure about this, but as far as I remember wildcards only include the files in the specified directory and not in it's subdirectories.
    However, the way you've currently got it setup is that inside of the sites-enabled folder there's a symlink to the sites-available folder, which contains the actual config. What happens if you go to the sites-enabled folder and do ln -s /etc/nginx/sites-available/WhatEverYouNamedYourConfig.conf? (AKA: the direct path to your config file)


  • @Xiph The symlink has now changed to default, rather than sites-available, which seems like what I was after, however no change to the actual issue, still can't access without using the port, even though it's off. 😕


  • @a_5mith said:

    @Xiph The symlink has now changed to default, rather than sites-available, which seems like what I was after, however no change to the actual issue, still can't access without using the port, even though it's off. 😕

    Does it give you a 502 Bad Gateway (or other 5xx) error when trying to access the site on the default port, or does it just not load at all?
    BTW: listen 80; will do, no need to include the 0.0.0.0 🙂 Sorry for the OCD.
    EDIT: Also, just assuming here you posted the server_name as site.info here for privacy reasons. 'cause if that's actually what you're using, that might explain something 😛


  • @Xiph

    Firefox can't establish a connection to the server at site.info.

    The site could be temporarily unavailable or too busy. Try again in a few moments.
    If you are unable to load any pages, check your computer's network connection.
    If your computer or network is protected by a firewall or proxy, make sure that Waterfox is permitted to access the Web.
    

    Don't even get the default nginx page. Just won't connect.

    Have changed the listen 80, saw that someone managed to get it working by adding it, as you can tell, it made no difference to me. 😆


  • @a_5mith said:

    @Xiph

    Firefox can't establish a connection to the server at site.info.

    The site could be temporarily unavailable or too busy. Try again in a few moments.
    If you are unable to load any pages, check your computer's network connection.
    If your computer or network is protected by a firewall or proxy, make sure that Waterfox is permitted to access the Web.
    

    Don't even get the default nginx page. Just won't connect.

    Have changed the listen 80, saw that someone managed to get it working by adding it, as you can tell, it made no difference to me. 😆

    Alright, so right now, the main problem appear to be that visitors don't connect to Nginx, at all. If it was just the connection to NodeBB that failed, you would've just gotten a gateway error. The connection between Nginx and NodeBB might be perfectly fine (or not, we don't know yet), but it looks like first we've got to fix Nginx itself.


  • @Xiph I'm inclined to agree. Question: Should I have a conf folder as well as a conf.d, because I don't...


  • @a_5mith said:

    @Xiph I'm inclined to agree. Question: Should I have a conf folder as well as a conf.d, because I don't...

    Well, the location for the missing mime.types your configuration specified was not inside a conf folder, so maybe not, but you can't be sure what other stuff might be missing.

    Some stuff to maybe check:

    • server_name is the same as the domain you're connecting to (duh)
    • You're only listening on IPv4 right now, so if your machine supports IPv6 and you've got an AAAA record set, or you're running on localhost which might be defined as the IPv6 loopback ::1 instead of the IPv4 loopback 127.0.0.1, TL;DR: if you're accessing the site over IPv6, it probably won't work, because Nginx is currently only listening on IPv4.
    • Nginx generally only uses the last version of the configuration that had no errors. If you've changed stuff and Nginx is still complaining when restarting, try fixing it and seeing if it uses the new configuration.

  • Tried both domain & IP, no dice.

    Copied mime.types from that conf folder into nginx and now get

    nginx: [emerg] "worker_processes" directive is not allowed here in /etc/nginx/mime.types:2

    line 2 had worker_processes 1

    This is so much fun. :sarcasm:

  • GNU/Linux Admin

    @a_5mith Your nginx seems to be down because you have a syntax error in your configs:

    nginx: [emerg] open() "/etc/nginx/mime.types" failed (2: No such file or directory) in /etc/nginx/nginx.conf:26
    nginx: configuration file /etc/nginx/nginx.conf

    Was the directory overwritten?

    And earlier I may have made a typo. sites-available and sites-enabled should have the same file structure, and they both should be contained in the same directory. One is not nested inside the other:

    sites-available
      \- default    # These two files are real files
      \- mynodebb
    
    sites-enabled
      \- default    # These two files are symlinks
      \- mynodebb
    

    When I said cd ../sites-enabled && ln -s ../sites-available, I meant to say: cd ../sites-enabled && ln -s ../sites-available/mynodebb, which would create a symlink to the mynodebb file in sites-available, in sites-enabled.

    English 😞


  • @julian Not as far as I'm aware, when I first installed nginx it was an old version, so I had to update. I shall remove nginx and try again with using new files instead of default.


  • Right, I gave up with nginx, so to save my sanity, I went with apache instead. Getting an internal server error when I add the contents of the guide.

    Noticed my bind address is 0.0.0.0, so I changed 127.0.0.1 to 0.0.0.0, but it didn't make a difference. 😞

    EDIT: Sorted it, now running without port. Followed Digital Oceans own guide on setting this up and it worked first time.

Suggested Topics

  • 1
  • 2
  • 3
  • 6
  • 1
| |