Last active
March 28, 2023 02:10
-
-
Save prokizzle/e8b4c08f040300e32474 to your computer and use it in GitHub Desktop.
Working Nginx Config for Faye over SSL
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 faye_server { | |
server 127.0.0.1:9292; | |
} | |
server { | |
# listen 80; | |
listen 443 ssl; | |
server_name your-faye-server.com; | |
ssl_certificate /home/your_user/.ssh/ssl.crt; | |
ssl_certificate_key /home/your_user/.ssh/ssl.key; | |
location / { | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_http_version 1.1; | |
proxy_set_header Access-Control-Allow-Headers 'Access-Control-Allow-Origin, Upgrade'; | |
proxy_set_header Access-Control-Allow-Origin subdomain.domain.com*; | |
add_header X-Real-IP $remote_addr; | |
add_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
add_header Host $http_host; | |
add_header X-NginX-Proxy true; | |
proxy_pass http://faye_server; | |
} | |
# thanks to http://nginx.org/en/docs/http/websocket.html | |
# and also https://gist.github.com/michiel/1064640 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment