Last active
November 4, 2023 10:40
-
-
Save ItsOnlyBinary/ae8d41c4542e66bb259b0f1b312c7d29 to your computer and use it in GitHub Desktop.
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
server { | |
listen 80; | |
listen [::]:80; | |
server_name kiwiirc.example.com; | |
location / { | |
# Redirect to https | |
return 301 https://$server_name$request_uri; | |
} | |
} | |
server { | |
listen 443 ssl; | |
listen [::]:443 ssl; | |
server_name kiwiirc.example.com; | |
ssl_certificate /etc/letsencrypt/live/kiwiirc.example.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/kiwiirc.example.com/privkey.pem; | |
location / { | |
index index.html; | |
# Path to kiwiirc client files | |
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 fileuploader 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 fileuploader to control the max size | |
client_max_body_size 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment