What is the difference between reload and restart in Nginx?
Reload (sudo systemctl reload nginx) applies new config without dropping connections (no downtime). Restart (sudo systemctl restart nginx) stops and starts Nginx (brief downtime). Use reload for config changes in production.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Installing and Configuring Nginx on Ubuntu for Node.js Deployment
Run sudo apt update and sudo apt install -y nginx. Start with sudo systemctl start nginx, enable with sudo systemctl enable nginx. Verify by visiting http://your-ip in a browser to see the welcome page.
nginx.conf is the main config. sites-available/ contains all site configs. sites-enabled/ contains symlinks to enabled sites. conf.d/ has additional configs. Create configs in sites-available, symlink to sites-enabled, remove the default, test, and restart.
Create a server block with listen 80, server_name your domain, and a location / block with proxy_pass http://localhost:3000. Add proxy_set_header directives for Host, X-Real-IP, X-Forwarded-For, X-Forwarded-Proto, and Upgrade/Connection headers for WebSocket support.
Still have questions?
Browse all our FAQs or reach out to our support team
