DevOps
Nginx
Check configuration, proxy requests and operate a web server.
Updated Official documentation ↗
Operate
nginx -tValidate configuration before reloadingnginx -s reloadReload after a successful configuration checksystemctl status nginxInspect the service on systemd hostsjournalctl -u nginx --since todayRead service logs on systemd hostsServer configuration
listen 80;Listen for HTTP trafficserver_name example.com;Match a hostnameroot /srv/www;Set the filesystem rootindex index.html;Choose the directory index fileReverse proxy directives
proxy_pass http://127.0.0.1:3000;Forward requests inside a location blockproxy_set_header Host $host;Preserve the request hostnameproxy_set_header X-Real-IP $remote_addr;Forward the direct client addressclient_max_body_size 10m;Bound accepted request-body size