• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

nginx halp plskthx [solved]

Scheduled Pinned Locked Moved General Discussion
52 Posts 5 Posters 19.8k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kevin
    wrote on last edited by kevin
    #1

    I guess i forgot how to set up nginx. What am I forgetting to do?

    I've installed nginx, got it to say 'welcome to nginx' through my domain url and IP address, added and aliased this file to sites-enabled/available:

    server {
    listen 80;
    
    server_name bikenode.com;
    
    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://178.62.247.86:4567/;
        proxy_redirect off;
    
        # Socket.IO Support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
       }
    }
    

    Reloaded nginx. Now i don't even get the 'Welcome to nginx' page. I just get 'Safari can't connect to the server.' Im forgetting something. Nginx is 1.6.x. ... I'm searching for an answer now but if someone has it before i can find it, awesome.

    1 Reply Last reply
    0
  • A Offline
    A Offline
    a_5mith
    wrote on last edited by a_5mith
    #2

    Check config.json in NodeBB folder for use port set as false and that the port is correct. Make sure you didn't type 4657 or anything like that.

    The symlink should be from sites-available to sites-enabled, not sure if this causes an issue if the other way around.

    Could also try removing the end forward slash from your proxy pass url, I'm on my iPad so can't cross reference mine with yours at the minute.

    Also nice theme. Might need to adjust the template as it mentions @trevor's site in the sidebar.

    1 Reply Last reply
    1
  • K Offline
    K Offline
    kevin
    wrote on last edited by kevin
    #3

    -config.json:

    {
    "base_url": "http://bikenode.com",
    "port": "4567",
    "secret": "******-*****-*****-*****-*********",
    "bind_address": "0.0.0.0",
    "database": "redis",
    "redis": {
        "host": "127.0.0.1",
        "port": "6379",
        "password": "",
        "database": "0"
    },
    "bcrypt_rounds": 12,
    "upload_path": "/public/uploads",
    "use_port": false,
    "relative_path": ""
    }
    

    -Symlink goes from -available to -enabled

    -The '/' in the line 'location / {' was part of what I copied and pasted, but I deleted it and tested it to see if it made a difference, and it didn't. Reverted it back.

    -Thanks for catching a convoe reference. I plan on changing it all up after it's stable and running. Until then I want to at least make it not say convoe everywhere. 😉

    Thanks for the guesses. Hopefully I'll figure this out and get back to messing with the theme.

    1 Reply Last reply
    0
  • T Offline
    T Offline
    termnml
    wrote on last edited by termnml
    #4
    PORT     STATE SERVICE
    22/tcp   open  ssh
    4567/tcp open  tram
    

    1st reason could be your nginx is not running at all.
    But you mentioned you restarted so I guess the 2nd possibility.

    /etc/init.d/nginx start
    

    your firewall is blocking port 80

    K 1 Reply Last reply
    1
  • K Offline
    K Offline
    kevin
    replied to termnml on last edited by kevin
    #5

    @termnml said:

    your firewall is blocking port 80

    nginx is definitely running. It's routing http://BikeNode.com to the same broken page as http://178.62.247.86/ . How do I check to see if my firewall is blocking 80?

    1 Reply Last reply
    0
  • T Offline
    T Offline
    termnml
    wrote on last edited by termnml
    #6

    @kevin
    That your domain is resolved to your IP adress is not the work of nginx. That does the DNS service for you.
    The Check depends on your server. If you manage it all your own eg root-server. Check: iptables -L -n
    If the output is very long simply do a iptables -L -n | grep :80

    If your firewall is set by any software/interface of your provider, you have to look there.

    K 1 Reply Last reply
    0
  • K Offline
    K Offline
    kevin
    replied to termnml on last edited by kevin
    #7

    @termnml
    ah you're right about dns. I don't think there is a firewall. I'm just using digitalocean. If i run iptables -L -n i get:

    Chain INPUT (policy ACCEPT)`
    target     prot opt source               destination
    
    Chain FORWARD (policy ACCEPT)`
    target     prot opt source               destination         
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    
    1 Reply Last reply
    0
  • A Offline
    A Offline
    a_5mith
    wrote on last edited by a_5mith
    #8

    When you run sudo service nginx reload, what do you get? Does it say fail? Or ok?

    What's the output of nginx -t

    K 1 Reply Last reply
    0
  • K Offline
    K Offline
    kevin
    replied to a_5mith on last edited by kevin
    #9

    @a_5mith

    root@$#!%:~/nodebb# service nginx reload
    * Reloading nginx configuration nginx                                   [ OK ] 
    root@$#!%:~/nodebb# nginx -t
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful
    
    1 Reply Last reply
    0
  • S Offline
    S Offline
    Scuzz
    wrote on last edited by
    #10

    try changing proxy_pass http://178.62.247.86:4567/; to proxy_pass http:127.0.0.1:4567/;

    K 1 Reply Last reply
    0
  • K Offline
    K Offline
    kevin
    replied to Scuzz on last edited by kevin
    #11

    Ran the following:

    root@$#!%:~# cd /etc/nginx/sites-available
    root@$#!%:/etc/nginx/sites-available# sudo nano bikenode.com
    
    
    
      GNU nano 2.2.6             File: bikenode.com                                 
    
    server {
        listen       80;
        server_name  bikenode.com;
        location / {
            proxy_pass        http:127.0.0.1:4567/;
    
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    
            proxy_redirect off;
           proxy_buffering   off;
    
          proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade"
        }
    }
    
    root@$#!%:/etc/nginx/sites-available# service nginx restart
    * Restarting nginx nginx                                                [ OK ] 
    

    @Scuzz, Doesn't appear to have made a difference. Cleared browser cache but let me know if it's working for anyone else.

    1 Reply Last reply
    0
  • T Offline
    T Offline
    termnml
    wrote on last edited by termnml
    #12

    I dont think it has anything to do with the configs.
    Otherwise nginx would complaining.
    I'm curious that your port 80 isn't visible to the outside at all.

    Which system is running?
    Debian, Ubuntu, CentOS?

    K 1 Reply Last reply
    0
  • K Offline
    K Offline
    kevin
    replied to termnml on last edited by
    #13

    @termnml latest ubuntu. If anyone's interested in peeking around i can send them a userid/pw.

    1 Reply Last reply
    0
  • T Offline
    T Offline
    termnml
    wrote on last edited by
    #14

    This sir is never a good idee 😉
    For such configs is always root needed.
    And don't give this access to "some guys" on the internet. 😉

    Latest Ubuntu? On a server? For production? O.o arg

    1 Reply Last reply
    0
  • T Offline
    T Offline
    termnml
    wrote on last edited by
    #15

    Could it be that you started with a LAMP setup and wanted to switch to nginx (because it is so awesome :D)?

    1 Reply Last reply
    0
  • K Offline
    K Offline
    kevin
    wrote on last edited by kevin
    #16

    I dont believe so. Im terrible with this stuff and was following the nodebb for dummies installation.

    T 1 Reply Last reply
    0
  • T Offline
    T Offline
    termnml
    replied to kevin on last edited by
    #17

    @kevin said:

    I dont believe so. Im terrible with this stuff and was following the nodebb for dummies installation.

    Was Apache installed on your system or nginx already?

    1 Reply Last reply
    0
  • K Offline
    K Offline
    kevin
    wrote on last edited by kevin
    #18

    I don't think so. just node-v0.10.33 on ubuntu 14.04.
    in the meantime i'll start a new droplet and see if I can't get it to work on that.

    1 Reply Last reply
    0
  • T Offline
    T Offline
    termnml
    wrote on last edited by termnml
    #19

    Could you paste logs for nginx (pastebin)?
    pastebin: option Paste Exposure: Unlisted

    Try to reach your normal domain and then do:

    tail /var/log/nginx/error.log 
    tail /var/log/nginx/access.log
    
    1 Reply Last reply
    0
  • K Offline
    K Offline
    kevin
    wrote on last edited by
    #20

    Pastebin.com - Not Found (#404)

    Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

    favicon

    Pastebin (pastebin.com)

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development