-
-
Save jameswhite/13c45cc9a918fa3f233a11fb758869ff to your computer and use it in GitHub Desktop.
Twitter reverse proxy configuration for Nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Settings on Twidere: | |
API URL Format: https://your-host/[DOMAIN.]twitter.com/ | |
Uncheck "Same OAuth signing URL" | |
Uncheck "No verion suffix" | |
Password login recommended. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream twitter_userstream { | |
server userstream.twitter.com:443; | |
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/(.*) { | |
resolver 8.8.8.8; | |
proxy_pass https://twitter_userstream/$1$is_args$args; | |
proxy_cookie_domain twitter.com $server_name; | |
proxy_buffering off; # Turn off buffer in order to get stream as-is | |
proxy_set_header Host userstream.twitter.com; | |
proxy_http_version 1.1; # This was necessary!!! | |
} | |
location ~ ^/([\w\d-_]+)\.twitter\.com/(.*) { | |
resolver 8.8.8.8; | |
proxy_pass https://$1.twitter.com/$2$is_args$args; | |
proxy_cookie_domain twitter.com $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