{"id":20053172,"url":"https://github.com/irezaul/nginx","last_synced_at":"2025-08-26T23:37:51.147Z","repository":{"id":140058232,"uuid":"395376539","full_name":"irezaul/nginx","owner":"irezaul","description":"NGINX Tutorial, virtual host, SSLcertificate installation, renewal, etc","archived":false,"fork":false,"pushed_at":"2021-08-12T12:40:32.000Z","size":570,"stargazers_count":0,"open_issues_count":0,"forks_count":10,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-02T09:14:03.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"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/irezaul.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":"2021-08-12T16:12:37.000Z","updated_at":"2021-08-13T00:16:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"2a2bd442-dda0-4dfc-a3a3-8c2c87d239b2","html_url":"https://github.com/irezaul/nginx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/irezaul/nginx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irezaul%2Fnginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irezaul%2Fnginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irezaul%2Fnginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irezaul%2Fnginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irezaul","download_url":"https://codeload.github.com/irezaul/nginx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irezaul%2Fnginx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272267714,"owners_count":24903760,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-13T12:23:19.516Z","updated_at":"2025-08-26T23:37:51.120Z","avatar_url":"https://github.com/irezaul.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Step-1: DNS Record check\n\u003e NS Record set \u0026 DNS Propagation check, A record Check\n\u003e `https://dnsmap.io/#A/spedfit.com` or `https://dnschecker.org/#A/www.spedfit.com`\n\n![dns_propagation_check](./screenshots/dns_propagation_check.png)\n\n### Note\n\u003e If you find the IP of the server from the search above, then you are ready to go to the next step.\n\n# Step-2: NGINX\n### Virtual Hosting using nginx\n\u003e `nano /etc/nginx/conf.d/spedfit.com.conf`\n\n```\nserver {\n        listen 80;\n        server_name spedfit.com;\n\t#expires 1d;\n\n\tlocation / {\n\n          #proxy_cache my_cache;\n\t  #proxy_buffering        on;\n\t  #proxy_cache_valid      200  1d;\n\t  #proxy_cache_use_stale  error timeout invalid_header updating\n          #http_500 http_502 http_503 http_504;\n\n          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n          proxy_set_header X-Forwarded-Proto $scheme;\n          proxy_set_header X-Real-IP $remote_addr;\n\t  proxy_set_header Host $host;\n          proxy_pass  http://127.0.0.1:8822;\n        }\n}\n```\n\n![nginx_config_directory](./screenshots/nginx_config_directory.png)\n\n## NGINX STATUS \u0026 RESTART\n\u003e sudo systemctl status nginx\\\n\u003e sudo systemctl reload nginx\\\n\u003e sudo systemctl restart nginx\n\n## NGINX Configuration check\n\u003e sudo nginx -t\n\n## Upload website/webapp files to the remote server\n\u003e **Windows**: using winscp [WinScp Download](https://winscp.net/eng/download.php)\\\n\u003e **Linux**: using ssh scp command ([Jenkins pipeline job](http://91.205.173.170:8080/job/JenkinsPipeline/pipeline-syntax/)/groovy script generator)\n\n# Creating a Systemd service file\n\u003e sudo nano /lib/systemd/system/spedfit.service\n\n```\n[Unit]\nDescription=Spedfit website\nAfter=network.target\n\n[Service]\nType=simple\nRestart=always\nRestartSec=5s\nWorkingDirectory=/home/mastererp/spedfit.com/\nExecStart=/home/mastererp/spedfit.com/spedfit\n\n[Install]\nWantedBy=multi-user.target\n```\n\n## Set permission\n\u003e sudo chmod 664 /lib/systemd/system/spedfit.service\n\n## Reload systemd daemon\n\u003e sudo systemctl daemon-reload\n\n## Check service status \u0026 Restart (just created)\n\u003e sudo service spedfit status\\\n\u003e sudo service spedfit start\n\n## Enable to start services automatically at boot\n\u003e sudo systemctl enable spedfit\n\n# Obtaining a certificate from letsencrypt.org\n### Single domain registration\n\u003e sudo certbot --nginx -d spedfit.com -d www.spedfit.com\n\n### Multiple domain registration\n\u003e sudo certbot --nginx -d spedfit.com -d www.spedfit.com\n\n## To Test the certificate and SSL Configuration\n\u003e `https://www.ssllabs.com/ssltest/analyze.html?d=spedfit.com`\n\n![certificate_report](./screenshots/spedfit_ssl_certificate_installation_report.png)\n\n## Check out nginx spedfit.com.conf again (too verify what changes made after obtained ssl certificate)\n![nginx_virtual_host_config_file](./screenshots/nginx_virtual_host_config_file.png)\n\n# Renew SSL Certificate\n\u003e sudo certbot renew --dry-run\n\n# Firewall open port \u0026 Reload\n\u003e sudo firewall-cmd --list-ports\\\n\u003e sudo firewall-cmd --permanent --add-port=8822/tcp\\\n\u003e sudo firewall-cmd --reload\\\n\u003e sudo firewall-cmd --list-ports\n\n## Set Execute permission to binary file\n\u003e sudo chmod +x /home/mastererp/spedfit.com/spedfit\n\n## Change owner permission\n\u003e sudo chown -R root:root /home/mastererp/spedfit.com/\n\n\n# Resource\n* [NGINX digitalocean setup guide](https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-centos-8)\n* [APACHE digitalocean setup guide](https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-centos-8)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firezaul%2Fnginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firezaul%2Fnginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firezaul%2Fnginx/lists"}