Last active
August 26, 2020 15:06
-
-
Save fabiomontefuscolo/6fdc76964638ea36293c74ecd4290301 to your computer and use it in GitHub Desktop.
nginx-docker-openfire.conf
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
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.com; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
listen [::]:443 ssl; | |
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; | |
server_name example.com; | |
# docker run -d | |
# --name dns-gen | |
# --restart always | |
# --log-opt "max-size=10m" | |
# -e GATEWAY=172.17.0.1 | |
# --volume /:/host:ro | |
# --volume /var/run/docker.sock:/var/run/docker.sock | |
# -p 127.0.0.54:53:53/udp | |
# jderusse/dns-gen | |
resolver 127.0.0.54; | |
set $openfire_upstream_domain "openfire.openfire.docker"; | |
location / { | |
include proxy_params; | |
proxy_pass http://$openfire_upstream_domain:9090; | |
} | |
location /http-bind/ { | |
include proxy_params; | |
proxy_pass http://$openfire_upstream_domain:7070; | |
} | |
location /ws/ { | |
include proxy_params; | |
proxy_http_version 1.1; | |
proxy_buffering off; | |
proxy_request_buffering off; | |
proxy_read_timeout 86400s; | |
proxy_send_timeout 86400s; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $connection_upgrade; | |
proxy_pass http://$openfire_upstream_domain:7070; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment