jublo / codebird-php

Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.
https://www.jublo.net/projects/codebird/php
GNU General Public License v3.0
775 stars 237 forks source link

codebird-cors-proxy not working with nginx server #230

Open chinna-magapu opened 6 years ago

chinna-magapu commented 6 years ago

Hi, I am trying to implement the codebird-cors-proxy in nginx server. But it was not working I ahve added cb.setProxy('https://twitterproxy.sample.xyz');

and the request token api https://twitterproxy.sample.xyz/oauth/request_token is getting 403 ( access is forbidden) and then I have updated the nginx config with the below code

`# nginx configuration

location / { rewrite ^/$ http://www.jublo.net/ redirect; rewrite ^(.*)$ /codebird-cors-proxy.php break; }`

hen the api url getting 405 error but its not working at all in my case.

can anyone suggest me where I am missing to make it work.

Thanks in Advance.

joshuaatkins commented 6 years ago

hi @chinna-magapu

This is our configuration for nginx, if it helps;

location /codebird/ {
        try_files $uri $uri/ /codebird/codebird-cors-proxy.php$is_args$args;
}
chinna-magapu commented 6 years ago

Hi @joshuaatkins , Thanks for your response.

I have updated the nginx config with your rewrite rules. still, I am getting the same 405 error. I am using this with angular it still fails in the options request with 405 status.

mynetx commented 5 years ago

@joshuaatkins Something for your debugging.

joshuaatkins commented 5 years ago

@chinna-magapu did you manage to solve this? I am happy to pick back up if not.