Last active
April 19, 2024 18:29
-
-
Save dskvr/4ea1937bd5c2161249146bc1edd2682e to your computer and use it in GitHub Desktop.
nginx configuration tips for myrelay.page and strfry
This file contains 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
#important! | |
map $http_accept $upstream { | |
default 127.0.0.1:8080; | |
application/nostr+json 127.0.0.1:7777; | |
} | |
server { | |
...other stuff | |
location / { | |
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; | |
if_modified_since off; | |
expires off; | |
etag off; | |
try_files /null @$http_upgrade; | |
} | |
location @websocket { | |
proxy_pass http://127.0.0.1:7777; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "Upgrade"; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
location @ { | |
add_header Access-Control-Allow-Headers *; | |
proxy_pass http://$upstream; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment