Troubleshooting Forever and port 4567
-
If they're existing images, I'm thinking they don't have the subfolder in the URL.
True, they don't, because before yesterday, I was accessing NodeBB by appending the port and subfolder like this: site.com:4567/forum. How do you suppose I can fix that now that I'm accessing it via site.com/forum.
I have a lot of images already.
-
The situation with images is this: existing images don't load and new images also don't load. If I attempt to insert an image, I get something like this:
![barts.gif](uploading100%)
. It never loads.Now, the path for existing images is something like this:
http://www.site.com/uploads/upload-67cc0ef9-0ea4-4d73-85ef-4521116b7cc5.png
. That's from the time I was accessing the site using its port number, before Nginx proxy came in to play.Now, the current image url is like this:
http://site.com/forum/topic/153/uploading100%
. The image never completely loads.Even after changing the upload_path from the default to "/forum/public/uploads", it still does not work
Do you have any ideas why and what can be used to solve this?
Something weird happens in the process uploading an image, as shown in this screenshot. It's visible for about 2 seconds before it reverts to normal.
-
@planner I have the same problem. When my home page is visited, nodebb send a [ "ws://..." 502 bad gateway ] on chrome console, and widgets are not loaded.
But after user click on any link, the error not occurring any more
I'm using nginx proxy bypass.
How you resolved this?Thanks
-
Because I have tons of images on the site that I could not use when accessing the site from a subfolder, I decided to run the site from a subdomain. So I abandoned the subfolder route.
-
@planner What is your config.json and ngix.conf?
Ps: I have used mydomain in this post instead of my real domain
my config.json:
{ "base_url": "http://www.mydomain.com", "port": "4567", "use_port": true, "secret": "-", "bind_address": "127.0.0.1", "database": "mongo", "mongo": { "host": "127.0.0.1", "port": "27017", "username": "-", "password": "-", "database": "-" }, "bcrypt_rounds": 12, "upload_path": "/public/uploads", "relative_path": "" }
And my nginx.conf
user www-data; worker_processes 4; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { ## # Basic Settings ## sendfile off; 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/*; server { listen 80; server_name www.mydomain.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://127.0.0.1:4567; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # # Specific for comet or long running HTTP requests, don't buffer up the # response from origin servers but send them directly to the client. # #proxy_buffering off; # supposedly prevents 502 bad gateway error; # ultimately not necessary in my case proxy_buffers 8 32k; proxy_buffer_size 64k; tcp_nodelay on; } } }
When user access the website, chrome send this error:
WebSocket connection to 'ws://www.mydomain.com/socket.io/1/websocket/zDbVq799NSBdGgWrBH0o' failed: Unexpected response code: 502
-
If you set ***relative_path to /forum and proxy_pass to http://127.0.0.1:4567/forum, it should work, but likely with the problem I had uploading images.
And if that is the real secret in your config.json, you might want to remove it.
-
@planner I'm using a single domain on my ec2 Instance...
So, i really need to set a relative path?That error started after to cloudflare dns pointed to my Elastic IP. Using only IP address, this error not occurred.
I need to set other config on nginx, like a site available or something else?