Last active
October 14, 2024 19:31
-
-
Save TorstenDittmann/010cd54bf6cb80039b2ead7c08fdc217 to your computer and use it in GitHub Desktop.
NGinx + Realtime
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
events { | |
worker_connections 1024; | |
} | |
http { | |
server { | |
listen 80; | |
listen 443; | |
# config for setting up and handling Appwrite SSL | |
# ssl_certificate /etc/ssl/private/YOUR_DOMAIN/cert.crt; | |
# ssl_certificate_key /etc/ssl/private/YOUR_DOMAIN/cert.key; | |
# ssl on; | |
# ssl_session_cache builtin:1000 shared:SSL:10m; | |
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
# ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; | |
# ssl_prefer_server_ciphers on; | |
server_name appwrite; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Port $server_port; | |
proxy_pass http://appwrite; | |
} | |
location /v1/realtime { | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Port $server_port; | |
proxy_pass http://appwrite-realtime; | |
proxy_http_version 1.1; | |
proxy_connect_timeout 7d; | |
proxy_send_timeout 7d; | |
proxy_read_timeout 7d; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment