[nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget)



  • @hek we can test it, in some minute i will add this plugin to our site, then post a comment and will see what happen!



  • @hek author of topic is admin!



  • Hello,

    As I posted almost a month a go I have a blog running on ghost and I am trying to use this plugin as a commenting engine on it. I can enable the plugin on few of the posts but not all of them. When is not working I am getting on the browser side the following:

    0_1450297996766_Screen Shot 2015-12-16 at 22.32.53.png

    and on the logs I can see the following message:

    16/12 15:28 [1593] - warn: [nodebb-plugin-blog-comments] Origin (undefined) does not match hostUrls: http://z0z0.me
    

    Is there anything I can do to get this work?

    Regards and thanks in advance.
    Peter



  • @Peter-Zoltan-Keresztes yes you should set resp.http.Access-Control-Allow-Origin = "http://z0z0.me"; in your web server ( Nginx or ht-access of Apache ) or vcl_backed of varnish



  • set resp.http.Access-Control-Allow-Origin = "http://z0z0.me";
    That is syntax in varnish vcl for others google how set Access Control Allow Origin



  • @sanatisharif said:

    resp.http.Access-Control-Allow-Origin = "http://z0z0.me";

    nginx does not seam to like it.



  • @sanatisharif said:

    set resp.http.Access-Control-Allow-Origin = "http://z0z0.me";
    That is syntax in varnish vcl for others google how set Access Control Allow Origin

    @Peter-Zoltan-Keresztes in Nginx you should use different syntax for setting allow origin.



  • My nginx config looks like this:

     server {
         listen       80;
         server_name  z0z0.me;
    
         #charset koi8-r;
         access_log  /var/log/nginx/z0z0/access.log  main;
         error_log  /var/log/nginx/z0z0/error_log;
     
         location / {
             add_header 'Acces-Control-Allow-Origin' '*';
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header HOST $http_host;
             proxy_set_header X-NginX-Proxy true;
    
             proxy_pass http://127.0.0.1:2369;
             proxy_redirect off;
         }
    
         location /comments {
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header HOST $http_host;
             proxy_set_header X-NginX-Proxy true;
    
             proxy_pass http://127.0.0.1:4567;
             proxy_redirect off;
        }
     }
    

    I am still getting the same error message.



  • @Peter-Zoltan-Keresztes said:

    add_header 'Acces-Control-Allow-Origin' '*';

    change this

     add_header 'Acces-Control-Allow-Origin' '*';
    

    to

    add_header 'Acces-Control-Allow-Origin' 'http://z0z0.me';


  • @sanatisharif I did that. the Access-Control has to be on the location / which is the blog or /comments which is the nodebb?



  • @sanatisharif because developer of plugin set a filed true to use cookie of forum for user authentication so you can't set * as Allow grigin.



  • @Peter-Zoltan-Keresztes blog because blog send a request to forum!



  • I did the change to:

        location / {
            add_header 'Access-Control-Allow-Origin' "http://z0z0.me";
    
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header HOST $http_host;
            proxy_set_header X-NginX-Proxy true;
    
            proxy_pass http://127.0.0.1:2369;
            proxy_redirect off;
        }
    

    But still not able to get it working.



  • @Peter-Zoltan-Keresztes said:

    I did the change to:

        location / {
            add_header 'Access-Control-Allow-Origin' "http://z0z0.me";
    
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header HOST $http_host;
            proxy_set_header X-NginX-Proxy true;
    
            proxy_pass http://127.0.0.1:2369;
            proxy_redirect off;
        }
    

    But still not able to get it working.

    please give me your forum url and your blog url and complete error on console



  • blog url is http://z0z0.me nodebb url http://z0z0.me/comments

    Full error on the console:

    16/12 18:22 [1593] - warn: [nodebb-plugin-blog-comments] Origin (undefined) does not match hostUrls: http://z0z0.me
    16/12 18:26 [1593] - warn: [nodebb-plugin-blog-comments] Origin (undefined) does not match hostUrls: http://z0z0.me
    16/12 18:28 [1593] - warn: [nodebb-plugin-blog-comments] Origin (undefined) does not match hostUrls: http://z0z0.me
    16/12 18:28 [1593] - warn: [nodebb-plugin-blog-comments] Origin (undefined) does not match hostUrls: http://z0z0.me
    16/12 18:30 [1593] - warn: [nodebb-plugin-blog-comments] Origin (undefined) does not match hostUrls: http://z0z0.me
    16/12 18:30 [1593] - warn: [nodebb-plugin-blog-comments] Origin (undefined) does not match hostUrls: http://z0z0.me
    16/12 18:32 [1593] - warn: [nodebb-plugin-blog-comments] Origin (undefined) does not match hostUrls: http://z0z0.me
    

    Full nginx config:

    server {
        listen       80;
        server_name  z0z0.me;
     
        #charset koi8-r;
        access_log  /var/log/nginx/z0z0/access.log  main;
        error_log  /var/log/nginx/z0z0/error_log;
    
        location / {
    	add_header 'Acess-Control-Allow-Origin' 'http://z0z0.me';
    #	add_header 'Access-Control-Allow-Credentials' 'true';
    #	add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
    #	add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type, DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With';
    
    	proxy_set_header X-Real-IP $remote_addr;
    	proxy_set_header HOST $http_host;
    	proxy_set_header X-NginX-Proxy true;
    
    	proxy_pass http://127.0.0.1:2369;
    	proxy_redirect off;
        }
    
        location /comments {
    #	set $cors '';
    
    #	if ($cors = 'true') {
    #		add_header 'Access-Control-Allow-Origin' "*";
    #		add_header 'Access-Control-Allow-Credentials' 'true';
    #		add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
    #		add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type, DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With';
    #	}
    
    #	if ($request_method = 'OPTIONS') {
    #		return 204;
    #	}
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header HOST $http_host;
            proxy_set_header X-NginX-Proxy true;
    
            proxy_pass http://127.0.0.1:4567;
            proxy_redirect off;
       }
    }


  • @Peter-Zoltan-Keresztes Now I'm get it, you have xhr request to same domain but diffrent port,
    Please commet set Alow origin in nginx config. And then reload nginx and send me feedbacks!

    If still have problem @Peter-Zoltan-Keresztes I think block of nodebb ( /comments ) isn't true!

    So /comment block should be:

    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header X-NginX-Proxy true;
                    proxy_pass http://127.0.0.1:4567
                    proxy_redirect off;
    

    Plus

    3 lines of socket io support! See nodebb doccs!


  • I have updated my nginx config to match the documentation and my nginx config looks like this:

    server {
       listen	80;
       server_name	z0z0.tk www.z0z0.tk;
       return 301 $scheme://z0z0.me$request_uri;
    }
    
    server {
        listen       80;
        server_name  z0z0.me;
    
        #charset koi8-r;
        access_log  /var/log/nginx/z0z0/access.log  main;
        error_log  /var/log/nginx/z0z0/error_log;
    
        location / {
    #	add_header 'Acess-Control-Allow-Origin' 'http://z0z0.me';
    #	add_header 'Access-Control-Allow-Credentials' 'true';
    #	add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
    #	add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type, DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With';
    
    	proxy_set_header X-Real-IP $remote_addr;
    	proxy_set_header HOST $http_host;
    	proxy_set_header X-NginX-Proxy true;
    
    	proxy_pass http://127.0.0.1:2369;
    	proxy_redirect off;
        }
    
        location /comments {
        	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";
       }
    }
    

    And it still not working. I am getting the same error.



  • @Peter-Zoltan-Keresztes I have updated the proxy_pas config to http://127.0.0.1:4567/comments or /comments/ no change. No matter what I do I am getting the same warning message for most of the blog posts while for some of them is working fine.



  • Any other suggestion which might help me make this plugin fully work?



  • @Peter-Zoltan-Keresztes
    I don't know, I have another problem with this plugin:

    one of topics will be purge from my forum and now I can't publish it again!!!


Log in to reply
 

Suggested Topics

| |