Created
August 17, 2025 10:43
-
-
Save impliedgg/2f15927b09ce35e93492f7cd78be589a to your computer and use it in GitHub Desktop.
nginx config includes/snippets for atproto/bluesky
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
| these are some includes you can drop into your nginx directory and use like so: | |
| --- | |
| server { | |
| listen 443; | |
| server_name pds.example.com; | |
| include atproto-show-motd.conf; | |
| include atproto-pds.conf; | |
| } | |
| server { | |
| listen 443; | |
| server_name *.bsky.example.com; | |
| include atproto-show-motd.conf; | |
| include atproto-handle-domain.conf; | |
| } | |
| --- | |
| make sure to add the following to your http config for websockets (ripped from nginx docs): | |
| --- | |
| map $http_upgrade $connection_upgrade { | |
| default upgrade; | |
| '' close; | |
| } | |
| --- | |
| see also: | |
| - https://whtwnd.com/did:plc:xz3euvkhf44iadavovbsmqoo/3lca5hhcqls27, a list of all the endpoints to reverse proxy | |
| - https://cprimozic.net/notes/posts/notes-on-self-hosting-bluesky-pds-alongside-other-services/, someone else's blog post on this exact problem |
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
| # include this file inside a server block for your handle domain wildcard (e.g. *.bsky.app or *.bsky.example.com) | |
| location /.well-known/atproto-did { | |
| proxy_pass http://127.0.0.1:2443; | |
| proxy_http_version 1.1; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| } |
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
| # include this for your server block for the pds (e.g. pds.example.com) | |
| location /xrpc { | |
| proxy_pass http://127.0.0.1:2443; | |
| proxy_http_version 1.1; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection $connection_upgrade; | |
| } | |
| location /.well-known/atproto-did { | |
| proxy_pass http://127.0.0.1:2443; | |
| proxy_http_version 1.1; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| } |
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
| # include this if you're not hosting anything else on the domains used for atproto/bsky. | |
| location / { | |
| proxy_pass http://127.0.0.1:2443; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment