nginx halp plskthx [solved]
-
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.
-
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.
-
-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.
-
@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?
-
@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 aiptables -L -n | grep :80
If your firewall is set by any software/interface of your provider, you have to look there.
-
@termnml
ah you're right about dns. I don't think there is a firewall. I'm just using digitalocean. If i runiptables -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
-
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
-
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.
-
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.
Pastebin (pastebin.com)