Nginx
Nginx, and Solutions.
502 Bad Gateway
:
:Nginx (, )
Solutions:
- : systemctl status app curl localhost:3000
- proxy_pass and
- PHP-FPM: socket and
- proxy_connect_timeout and proxy_read_timeout
:, systemd
403 Forbidden
:
:Nginx /
Solutions:
- : ls -la /var/www/html/
- Nginx ( www-data nginx)
- : chmod 644 files, chmod 755 directories
- : chown -R www-data:www-data /var/www/html/
- SELinux: getenforce, Enforcing
:,
nginx: [emerg] unknown directive / unexpected "}"
: nginx -t nginx -s reload
:Syntax(, )
Solutions:
- {}
- include
- nginx -T
: nginx -t, Nginx Syntax
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
: Nginx
:80 (Apache, Nginx )
Solutions:
- : sudo lsof -i :80 sudo ss -tlnp | grep :80
- : sudo systemctl stop apache2
- Nginx : sudo killall nginx
- : listen 8080;
: Web, Apache
504 Gateway Timeout / upstream timed out
: API
:Nginx proxy_read_timeout( 60s)
Solutions:
- : proxy_read_timeout 300s;
- : proxy_connect_timeout 60s; proxy_send_timeout 300s;
- ( ID, )
: API,