Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history

setup-nginx.sh

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

setup-nginx.shBlame64 lines · 1 contributor
8ade77bClaude1#!/bin/bash
2set -euo pipefail
3
4# ============================================
5# Nginx + HTTPS setup for gluecron
6# ============================================
7
8DOMAIN="${1:-gluecron.com}"
9
10echo "Setting up nginx for $DOMAIN..."
11
12# Install nginx + certbot
13sudo apt-get update
14sudo apt-get install -y nginx certbot python3-certbot-nginx
15
16# Create nginx config
17sudo tee /etc/nginx/sites-available/gluecron > /dev/null << NGINX
18server {
19 listen 80;
20 server_name $DOMAIN www.$DOMAIN;
21
22 # Allow large git pushes
23 client_max_body_size 500m;
24
25 location / {
26 proxy_pass http://127.0.0.1:3000;
27 proxy_http_version 1.1;
28 proxy_set_header Host \$host;
29 proxy_set_header X-Real-IP \$remote_addr;
30 proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
31 proxy_set_header X-Forwarded-Proto \$scheme;
32
33 # Required for git smart HTTP protocol
34 proxy_buffering off;
35 proxy_request_buffering off;
36
37 # Timeouts for large repos
38 proxy_connect_timeout 300;
39 proxy_send_timeout 300;
40 proxy_read_timeout 300;
41 }
42}
43NGINX
44
45# Enable site
46sudo ln -sf /etc/nginx/sites-available/gluecron /etc/nginx/sites-enabled/
47sudo rm -f /etc/nginx/sites-enabled/default
48sudo nginx -t
49sudo systemctl reload nginx
50
51# Get SSL cert
52echo "Getting SSL certificate..."
53sudo certbot --nginx -d "$DOMAIN" -d "www.$DOMAIN" --non-interactive --agree-tos --email "admin@$DOMAIN" || {
54 echo ""
55 echo "Certbot failed — DNS may not be pointed yet."
56 echo "Once DNS is live, run:"
57 echo " sudo certbot --nginx -d $DOMAIN -d www.$DOMAIN"
58}
59
60echo ""
61echo "Nginx configured for $DOMAIN"
62echo " HTTP -> HTTPS redirect: automatic (after cert)"
63echo " Proxy -> localhost:3000"
64echo " Max upload: 500MB (for large repos)"