{"id":24650450,"url":"https://github.com/muzammil-git/nginx-setup","last_synced_at":"2025-03-20T20:37:55.914Z","repository":{"id":273751157,"uuid":"920759867","full_name":"muzammil-git/nginx-setup","owner":"muzammil-git","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-22T18:37:31.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T19:28:36.375Z","etag":null,"topics":["configuration","nginx"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muzammil-git.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-22T18:14:57.000Z","updated_at":"2025-01-22T18:37:34.000Z","dependencies_parsed_at":"2025-01-22T19:28:39.394Z","dependency_job_id":"16367257-d897-49c6-859c-d0e6f5e1be0f","html_url":"https://github.com/muzammil-git/nginx-setup","commit_stats":null,"previous_names":["muzammil-git/nginx-setup"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muzammil-git%2Fnginx-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muzammil-git%2Fnginx-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muzammil-git%2Fnginx-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muzammil-git%2Fnginx-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muzammil-git","download_url":"https://codeload.github.com/muzammil-git/nginx-setup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244685678,"owners_count":20493308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","nginx"],"created_at":"2025-01-25T18:15:08.029Z","updated_at":"2025-03-20T20:37:55.898Z","avatar_url":"https://github.com/muzammil-git.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx Server Configuration Guide + File\n\nThis README explains the Nginx configuration for setting up a secure web server with SSL/TLS encryption and HTTP to HTTPS redirection for abc.com.\n\n## Configuration Overview\n\nThe configuration consists of two server blocks:\n1. Main HTTPS server (Port 443)\n2. HTTP redirect server (Port 80)\n\n## HTTPS Server Block\n\nThis server block handles secure HTTPS traffic:\n\n```nginx\nserver {\n    server_name 40.20.40.100 abc.com;\n    \n    # Proxy Configuration\n    location / {\n        proxy_pass http://127.0.0.1:8000;\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection 'upgrade';\n        proxy_set_header Host $host;\n        proxy_cache_bypass $http_upgrade;\n    }\n\n    # SSL Configuration\n    listen 443 ssl;\n    ssl_certificate /etc/letsencrypt/live/abc.com/fullchain.pem;\n    ssl_certificate_key /etc/letsencrypt/live/abc.com/privkey.pem;\n}\n```\n\n### Key Components:\n- Listens on port 443 (HTTPS)\n- Serves content for both IP (40.20.40.100) and domain (abc.com)\n- Proxies requests to a local service running on port 8000\n- Uses Let's Encrypt SSL certificates\n\n## HTTP Redirect Block\n\nThis server block handles HTTP traffic and redirects it to HTTPS:\n\n```nginx\nserver {\n    server_name 40.20.40.100 abc.com;\n    listen 80;\n\n    if ($host = abc.com) {\n        return 301 https://$host$request_uri;\n    }\n\n    return 404;\n}\n```\n\n### Key Components:\n- Listens on port 80 (HTTP)\n- Automatically redirects HTTP traffic to HTTPS\n- Returns 404 for any unmatched requests\n\n## SSL Certificate Information\n\nThe configuration uses Let's Encrypt SSL certificates:\n- Certificate path: `/etc/letsencrypt/live/abc.com/fullchain.pem`\n- Private key path: `/etc/letsencrypt/live/abc.com/privkey.pem`\n\n## Proxy Settings\n\nThe configuration includes the following proxy settings for WebSocket support and proper header handling:\n- `proxy_http_version 1.1`\n- `proxy_set_header Upgrade $http_upgrade`\n- `proxy_set_header Connection 'upgrade'`\n- `proxy_set_header Host $host`\n- `proxy_cache_bypass $http_upgrade`\n\n## Notes\n\n- This configuration is managed by Certbot for SSL certificate automation\n- All HTTP traffic (port 80) is automatically redirected to HTTPS (port 443)\n- The server proxies requests to a local service running on port 8000\n- Both the domain name and IP address are configured to serve the content\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuzammil-git%2Fnginx-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuzammil-git%2Fnginx-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuzammil-git%2Fnginx-setup/lists"}