Skip to content

Instantly share code, notes, and snippets.

@sistematico
Forked from ItsOnlyBinary/kiwiirc-nginx.conf
Last active September 9, 2020 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sistematico/1fd362441deda1cef3e92d0f3a5e029b to your computer and use it in GitHub Desktop.
Save sistematico/1fd362441deda1cef3e92d0f3a5e029b to your computer and use it in GitHub Desktop.
Nginx + KiwiIRC Reverse Proxy
server {
listen 80;
listen [::]:80;
server_name chat.site.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 5m;
ssl_certificate /etc/letsencrypt/live/radiochat.com.br/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/radiochat.com.br/privkey.pem;
server_name chat.site.com;
location / {
index index.html;
root /usr/share/kiwiirc/;
}
location /webirc/ {
# Forward incoming requests to local webircgateway socket
proxy_pass http://127.0.0.1:7778/webirc/;
# Set http version and headers
proxy_http_version 1.1;
# Add X-Forwarded-* headers
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
# Allow upgrades to websockets
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /files/ {
# Forward incoming requests to local fileupload instance
proxy_pass http://127.0.0.1:8088/files/;
# Disable request and response buffering
proxy_request_buffering off;
proxy_buffering off;
proxy_http_version 1.1;
# Add X-Forwarded-* headers
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
# Allow upgrades to websockets
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment