Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Twitter reverse proxy configuration for Nginx
Settings on Twidere:
API URL Format: https://your-host/[DOMAIN.]
Uncheck "Same OAuth signing URL"
Uncheck "No verion suffix"
Password login recommended.
upstream twitter_userstream {
keepalive 300;
server {
listen 443 ssl spdy;
server_name [YOUR-SERVER-NAME-HERE];
ssl_certificate [/path/to/ssl/certificate/cert.pem];
ssl_certificate_key [/path/to/ssl/certificate/privkey.pem];
location ~ ^/userstream\.twitter\.com/(.*) {
proxy_pass https://twitter_userstream/$1$is_args$args;
proxy_cookie_domain $server_name;
proxy_buffering off; # Turn off buffer in order to get stream as-is
proxy_set_header Host;
proxy_http_version 1.1; # This was necessary!!!
location ~ ^/([\w\d-_]+)\.twitter\.com/(.*) {
proxy_pass https://$$2$is_args$args;
proxy_cookie_domain $server_name;
location / {
root [/path/to/welcome/file];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment