facebook,nginx,service,web-crawler , Redirecting Crawler to internal service

Redirecting Crawler to internal service


Tag: facebook,nginx,service,web-crawler

I want to setup nginx to have certain crawlers get data from an internal service running on port 9998.

So for instance, when a browser requests www.mywebsite.com/resource/1 it will look at the root folder but when the same resource is requested by a crawler (for instance the FB crawler) it should get the page returned by the service at

This is the config I came up with but doesn't work as intended. The user agent is correctly identified, but the data is not obtained from the service.

    location / {
        if ($http_user_agent ~ Facebot) {

        root /etc/www/website;
        try_files $uri /index.html;
        ... other stuff...


Add a break after the proxy_pass.

location / {
    if ($http_user_agent ~ Facebot) {

    root /etc/www/website;
    try_files $uri /index.html;
    ... other stuff...


Facbook Friends Likes count for a page in html

I want To Display count that number of friends liked a page in html anyone please tell me and i know by using simple url we can get the page likes but i want know how to get the count of friends who liked a page and that too i...

PHP: Tor check not working

I've installed a Tor relay and Nginx and created my .onion on my Linux server. In torrc HiddenServicePort 80 In nginx's default: listen 8747 I've modified TorDNSExitList's PHP Pear Net_DNS to use Net_DNS2. When I echo out the $ip, $myip, $myport I get: ip = my ip =...

How can I avoid uwsgi_modifier1 30 and keep WSGI my application location-independent?

I have a WSGI application using CherryPy hosted using uWSGI behind a ngnix server. I would like for the application itself to be "portable". That is, the application should not know or care what URL it is mapped to, and should even work if mapped to multiple different URLs. I...

difference between componentDidMount and getInitialState in Reactjs

I understand that getInitialState is called once in the component's lifecycle and componentDidMount is called when the component is rendered. So does that mean both will get called just once in the component's lifecycle? What's the difference?...

How do I turn sendfile off in a docker instance

I have a nginx docker instance running. In the docker instance there is a file called /etc/nginx/nginx.conf It has the following settings http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" access_log /var/log/nginx/access.log main; sendfile on; .... } I run the docker instance by running with...

Facebook Android API asks for additional permission

I am using v2.3 api here I can login with Facebook login button. Now how can I call additional permission on click? I have looked through answers for this question, but all of them look to be back-dated. Can someone show me the right way of asking for addition permission...

Bluemix authentication ios8 with google and facebook

I am trying to implement two types of authentication from an iOS8 device in the bluemix platform. I succeeded in adding one type of authentication: google. I am using a ADVANCED MOBILE ACCESS module, and I am at the User Authentication part. It looks from a dashboard like I can...

Graph API get user id facebook

How can I do this? Im using Graph API v2.3 I am able to get the access token, but I don't know how to get the user's ID....

Opening facebook in a panel of winforms

I am in need to open facebook(whatsapp,skype etc) with in a panel. please suggest something to achieve the same. I working on windows 7. If facebook is not possible then please suggest with whatever the task is possible whether with facebook messenger,whatsapp (site or app),skype or any other social networking...

Access Token of Facebook changed by user, How to get call back for Access Token?

I am using Facebook SDK 4.2. I have implemented AccessTokenTracker interface, which is working if token is changed. My question is : If user got publish_permission for post something from Android app. Then I remove that permission from my Facebook account. Now in app, the token return from AccessToken accessToken...

Nginx, how to allow DOMAIN:PORT and IP:PORT requests

What's the proper way to configure Nginx to allow DOMAIN:PORT requests like this: http://example.com:8080/?a=xxx&b=yyy&c=zzz over TCP or UDP And IP:PORT requests like this: over TCP or UDP Nginx also must allow domain requests like these, which already work correctly on my setup: http://example.com/home http://example.com/work over TCP For the IP:PORT...

share on facebook: to use a different url in the open graph tags

I have a superheroes quiz game at this address: mysite/index.html, the quiz has 2 possible results mysite/result1.html and mysite/result2.html. Each result page has the open graph tags as: <meta property="og:type" content="website" /> <meta property="og:title" content="Great you are Superman" /> <meta property="og:description" content="Description of Superman" /> <meta property="og:url" content="mysite/result1.html" /> <meta...

how to share screenshot to Facebook

I've already done that screenshot part, but still haven't found any solution to share the screenshot image to Facebook by using FBSDKSharePhoto. Facebook doesn't provide enough references for it. Can anyone please guide me here? Here is my screenshot code just in case: CGRect screenRect = [[UIScreen mainScreen] bounds]; UIGraphicsBeginImageContextWithOptions(screenRect.size,...

Does Facebook allow preloading a specific message from a user to a page?

I know that Facebook allows web intents of sharing URLs, along with the ability to select whether it goes into a message, or to your wall, but I was wondering if there is an ability to do something where a user can click a link/button, and it opens up a...

How to easily use the Facebook API Realtime Updates feature?

First off, apologies for posting yet another question on Facebook Realtime Updates. I have read many existing stackoverflow answers and useful articles which helped, but I still can't seem to figure out how to put everything together. Also, this is the first time I use Facebook and it's API, so...

IOS: Easy Facebook SDK email retrieval Objective C

EDIT (Rewording the Question because it didn't make sense before.) I have a loginViewController that has he following IBAction: -(IBAction)fblogin:(id)sender { FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init]; [login logInWithReadPermissions:@[@"email"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { if (error) { // Process error } else if (result.isCancelled) { // Handle cancellations } else...

Creating a website for a restaurant with facebook api [closed]

I've my own webdevelopment company and I have a new customer this week who wants to have a facebook API on his site. I've worked with the API before for my personal website but never with a customer. And my question was what is the best way to get a...

Facebook - “Cannot query users by their username” solution

I am developing an android app. I was using a HttpURLConnection to get profile pictures of facebook users. The URL looks like this: http://graph.facebook.com/?ids=username1,username2,username3&fields=picture&type=square But now, since v2.2 doesn't let me to get profile pictures of users who are not using my facebook app, it throws an error: { "error":...

django get the social token form allauth

Hello i tried to get the social token from the DB but i get this error. I can't find any answer to this and tried everything i can think of. Please if anyone knows how to fix this. NameError at / name 'user' is not defined Request Method: GET Request...

angularjs ngfacebook batch request

Can anyone who knows how to use the angularjs ngFacebook module help me to perform a facebook batch request? Is it possible to do it with this module? What I need exactly is to get the user events from facebook, for that I have to do 4 different request: $facebook.api('/me/events/attending').then(function(response)...

Wrap resources inside custom class and invoke class?

I am using Puppet 3.0. I tried to use the existing NGINX module but encountered one issue which no answer seems to exist. I have moved to implementing NGINX module myself which handles my exact requirements. Each package/service/file resource works as expected and now I am moving the code out...

Login with Facebook option trigger suggest to download an app

Yesterday I logged in to Airbnb with my Facebook account on my OSX. Shortly later I got a notification both on my iPhone and computer saying "Airbnb is available to install on your iPhone" My question is, does anyone here know how this was done? Is this a feature available...

Agree to my privacy policy when sign up to my site via facebook

My site has privacy policy and terms of service, when user registered required to agree to both of them. But also I have option of sign up with facebook. Do user required to agree to my privacy policy and terms of service when signing up to my site with facebook?...

Roundcube - Nginx does not redirect to .php file automatically

EDITED! I set up a mail server on Debian 7 with Nginx, Postfix, Postfixadmin, Dovecot and Roundcube. I tried to create an alias to use the SSL certificate of my domain example.org (of course, the domain here is an example) for the webmail. When accessing the following URL https://example.org/support/webmail/ -...

Facebook Marketing API some field are not shown

I have a development level access to Marketing API and it looks like I cannot read some fields of specific objects. For example I try the following call: You can see that promoted_object, link_url and object_url are not displayed in the result. And I should have one of those three...

What does `expires -1` mean in NGINX `location` directive?

Given the sample location example below, what does -1 mean for expires? Does that mean "never expires" or "never caches"? # cache.appcache, your document html and data location ~* \.(?:manifest|appcache|html?|xml|json)$ { expires -1; access_log logs/static.log; } https://github.com/h5bp/server-configs-nginx/blob/master/h5bp/location/expires.conf...

Facebook API profile picture

I created a website for my Students Organization. On that website there is a page where I list all the people who helped organize our Activities. Theres a picture of every member there. To get the images, I used their facebook profile pictures. I used http://graph.facebook.com/USERNAME/picture?height=250&width=250 This code did work...

facebook post on page wall - PHP SDK

I'm trying to create a script that post on a facebook page (as an administrator) a status. This is the script i'm using: try { $access_token = (new FacebookRequest( $session, 'GET', '/' . $pageID, array( 'fields' => 'access_token' ) )) ->execute()->getGraphObject()->asArray(); $access_token = $access_token['access_token']; $page_post = (new FacebookRequest( $session, 'POST',...

In Facebook marketing API, where to set target URL of an Ad Campaign

I would like to create an Ad Campaign with the Marketing API but I don't know where I can set the target URL of this campaign. I can set the objective of the campaign to WEBSITE_CLICKS but where to set the URL it will goes to? If I use the...

need a neat way to create a dynamic facebook sharing technique with custom parameters

Since Sharer's ability to accept custom parameters is dead which was the easiest way for a noob like me, I am a bit puzzled with all the FB.ui n OGP talk everywhere. I am not sharing via any app. So do not suggest a method that needs any app_id. I...

Converting .htacess to nginx

The following is the .htaccess, RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] I used winginx to the get nginx rewrite which is, rewrite ^/(.+)$ /index.php?url=$1 last; But it not working the desired. The original URL is: http://xxxx/foo/info/getinfo/123/ The converted URL should be: http://xxx/foo/index.php?url=info/getinfo/123/...

NGINX Serve all static files and forward others to proxy without / giving 403?

I'm trying to configure an nginx server to act as a proxy to a node application. What I would like is to have any static files served by nginx and all other paths forwarded on to the Node.js application (inluding the / path). I've seen the following question/answers: How to...

Facebook logout iOS SDK

In the latest SDK of Facebook for iOS 8, the login button itself changes to logout once the user logs in successfully. I have a separate logout button in my applications. When the user is successfully logged in using my own server credentials, google+ or facebook, the app takes the...

I need to retrieve facebook user language with php

I'm building a very simple facebook app in which i would like to retrieve the facebook user language. Since now, i retrieve the browser language to give the right language for the user but I think that retrieving the facebook user language is better and more precise. Is there someone...

Fetching Data From Multiple Facebook API's then Adding Together

JQuery Snippet // THE FOUR URL'S TO ADD THE TOTAL SHARES var Gal_All = "Link One"; var Gal_S_1 = "Link Two"; var Gal_S_2 = "Link Three"; var Gal_S_3 = "Link Four"; $.ajax({ type: 'GET', url: 'https://graph.facebook.com/' + Gal_All, success: function(data) { showCount(data); } }); var fbshares; var fbcomments; function showCount(responseText)...

Facebook Permission Graph API

try { $response = (new FacebookRequest($session, 'GET', '/me/permissions'))->execute(); $object = $response->getGraphObject() -> asArray(); echo '<pre>'; print_r($object); echo '</pre>'; //problem lies over here for($i = 0 ; $i <count($object['data']); $i++){ echo "<br>" . $object['data'][$i] -> permission; } } catch (FacebookRequestException $ex) { echo $ex->getMessage(); } catch (\Exception $ex) { echo $ex->getMessage();...

Tornado behind Nginx, should I use TCP nodelay config in python or nginx.conf?

I have a Tornado server running behind Nginx reverse proxy. The proxy is configured with tcp_nodelay: on. I see there's also an option to call WebSocketHandler.set_nodelay(True) on a WebSocket instance once it's connected. Do these two create the same effect? Are there pro's con's for using one over the other?...

Facebook SDK 4.2 FBGraphUser protocol update

I am working on an Xcode project that has Facebook SDK 3.1.4. I am currently updating the SDK to 4.2. I was just wondering if someone can help me with the update related to FBGraphUser protocol and how I can update that for Facebook SDK 4.2. I have looked around...

Changes in Javascript not being reflected while debugging Web page

I am working on a web page development using netbeans IDE and use Firefox for debugging/testing. Whenever i do changes to Javascript, these changes are not getting reflected on the web page,the source code reveals the obsolete code. Everytime i make changes, i ensure to restart my nginx server before...

How to change default Nginx setting on Homestead Laravel Virtualbox VM

I merely followed the default Laravel Homestead setup here using VirtualBox. Working great. But I need an additional Nginx rewrite setting in my apps vhost file on the VM, something like; location / { if ($request_method !~ "(POST)"){ rewrite .... } try_files $uri $uri/ /index.php?$query_string; } I can add that...

Only allow certain countries traffic access specific page

I am using --with-http_geoip_module for identify traffic. There are some pages that I only want certain country to access. Here is configuration: For http http{ geoip_country /usr/share/GeoIP/GeoIP.dat; # the country IP database map $geoip_country_code $allowed_country { default 0; US 1; UK 1; HK 1; } } The location directive: location...

Using Graph API Explorer gets friends list but my own app doesn't . (Graph API Explorer token v.s App Token)

I am trying to get my friends list in my app. If I use the access token in my Graph API Explorer console and hit the url. https://graph.facebook.com/v2.3/me?access_token='GraphAPIToken'. I am able to get the complete friends list. If I try using the SDK or any library like fbgraph for nodejs...

Facebook LogIn and Parse

I've just added Facebook login to my app, I can retrieve the data I need. But I'm not completely sure what to do with it. My app already works with normal users to Parse.com (which I registered on a register screen that I have created in my app). But what...

Facebook user to Parse.com

How do I get the data from The Facebook user to Parse.com? The code that I will provide below makes a user but it doesn't update it with data when I login, why is it not working? public class LoginActivity extends Activity { private EditText usernameView; private EditText passwordView; @Override...

Unable to share message in Facebook API 4.0, with error : Error publishing message

Currently using Facebook 4.0 API, I try to publish message, but I receive the error as following: Error: Error publishing message Looking for help on this issue. private CallbackManager callbackManager; private ShareDialog shareDialog; private FacebookCallback<Sharer.Result> shareCallback = new FacebookCallback<Sharer.Result>() { @Override public void onCancel() { Log.d("HelloFacebook", "Canceled"); } @Override public...

Facebook Debugger Returning “Document returned no data”

Recently I noticed that Facebook's Object Debugger was unable to scrape any pages of my website. After troubleshooting and scouring the internet, I'm at a loss for what might be causing this bug. Whenever I attempt to fetch a new scrape of my website, the following error is returned: Error...

Nginx block access to referring url

I've discovered a domain is pointing to my servers IP address as an A-record. I've tried to implement various measures to have have it blocked. I can block it accessing assets on the server i.e loading JS/CSS files and I can block it when a link is accessed from within...

login with facebook and capture photo via Camera and share on own wall

I searched many sites, but I still can't solve this issue, the problem is that I can't seem to be able to post the data. My code: public class MainActivity extends Activity { // Your Facebook APP ID private static String APP_ID = "397909153726269"; // Replace with your App ID...

nginx- duplicate default server error

In my error log i get [emerg] 10619#0: a duplicate default server for in /etc/nginx/sites-enabled/mysite.com:4 on Line 4 I have: server_name mysite.com www.mysite.com; Any suggestions?...

Nginx ldap auth login by different attributes

I need to configure nginx to sign in by two kinds dn : cn=appname,ou=Applications,o=example.com uid=username,ou=People,o=example.com Here is piece of code for ldap server: ldap_server ldapserver { url ldaps://ldap.example.com/o=example.com?uid,cn?sub?(..filter for search...) } However, only username can be signed in, appname can't. But if I switch the position of uid and cn...